用于存储JSON的Oracle CLOB的替代方案(Alternatives to Oracle CLOB for Storing JSON)
在Oracle 10g中存储除
CLOB
之外的大量数据还有其他替代方法吗? 我需要在此字段中存储的JSON文件的最大大小为150Kb。 我可以将VARCHAR2
或NTEXT
用于此目的吗? 如果有必要避免使用CLOB
,则JSON文件的内容也可以作为文本复制。 在此先感谢您的帮助。Are there any other alternative for storing large amounts of data other than
CLOB
in Oracle 10g? The maximum size of JSON file that I need to store in this field is 150Kb. Can I useVARCHAR2
orNTEXT
for this purpose? The content of JSON file may be copied as text too if it is necessary to avoid using aCLOB
. Thanks in advance for any help.
原文:https://stackoverflow.com/questions/26841134
最满意答案
对我有用的是在HTTPS连接器上设置TrustManagerFactory。 这是我如何做到的。
首先,创建一个包含要信任的SSL服务器证书的密钥库。 您可以使用JDK附带的工具创建密钥库( 这是一个示例 )。
然后,创建一个FactoryBean,在给定JKS密钥库和密码的情况下为您提供TrustManagerFactory。 这是我使用Spring资源的一个,所以我可以从类路径或文件系统提供密钥库:
public class ExampleFactoryBean implements FactoryBean<TrustManagerFactory> { private Resource keystore; private String password; @Override public TrustManagerFactory getObject() throws Exception { KeyStore truststore = KeyStore.getInstance("JKS"); truststore.load(keystore.getInputStream(), password.toCharArray()); TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); tmf.init(truststore); return tmf; } @Override public Class<?> getObjectType() { return TrustManagerFactory.class; } @Override public boolean isSingleton() { return true; } public void setKeystore(Resource keystore) { this.keystore = keystore; } public void setPassword(String password) { this.password = password; } }
最后,在HTTP连接器上设置TrustManagerFactory,如下所示:
<https:connector name="myHttpsConnector"> <spring:property name="trustManagerFactory"> <spring:bean class="com.mycompany.ssl.ExampleFactoryBean"> <spring:property name="keystore" value="classpath:mykeystore.keystore" /> <spring:property name="password" value="mypassword" /> </spring:bean> </spring:property> </https:connector>
What worked for me is to set the TrustManagerFactory on the HTTPS connector. Here's how I did it.
First, create a keystore that contains the certificate of the SSL server you want to trust. You can create the keystore using the tools included with the JDK (here's an example).
Then, create a FactoryBean that gives you a TrustManagerFactory given a JKS keystore and password. Here's one I made that uses a Spring resource, so that I can provide the keystore from the classpath or from the filesystem:
public class ExampleFactoryBean implements FactoryBean<TrustManagerFactory> { private Resource keystore; private String password; @Override public TrustManagerFactory getObject() throws Exception { KeyStore truststore = KeyStore.getInstance("JKS"); truststore.load(keystore.getInputStream(), password.toCharArray()); TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); tmf.init(truststore); return tmf; } @Override public Class<?> getObjectType() { return TrustManagerFactory.class; } @Override public boolean isSingleton() { return true; } public void setKeystore(Resource keystore) { this.keystore = keystore; } public void setPassword(String password) { this.password = password; } }
Finally, set the TrustManagerFactory on the HTTP connector like so:
<https:connector name="myHttpsConnector"> <spring:property name="trustManagerFactory"> <spring:bean class="com.mycompany.ssl.ExampleFactoryBean"> <spring:property name="keystore" value="classpath:mykeystore.keystore" /> <spring:property name="password" value="mypassword" /> </spring:bean> </spring:property> </https:connector>
相关问答
更多-
java类信任所有用于将文件发送到https Web服务(java class to trust all for sending file to https web service)[2023-06-18]
对我有用的是在HTTPS连接器上设置TrustManagerFactory。 这是我如何做到的。 首先,创建一个包含要信任的SSL服务器证书的密钥库。 您可以使用JDK附带的工具创建密钥库( 这是一个示例 )。 然后,创建一个FactoryBean,在给定JKS密钥库和密码的情况下为您提供TrustManagerFactory。 这是我使用Spring资源的一个,所以我可以从类路径或文件系统提供密钥库: public class ExampleFactoryBean implements FactoryBe ... -
事实证明,除了您加载原始页面的服务器之外,您不允许通过https与任何其他服务器通信。 它是ajax / javascript安全规范的一部分。 所以这个解决方案根本不起作用。 我将不得不研究服务器端代理请求解决方案。 Turns out you are not allowed to talk to any other servers via https using javascript other than the server you loaded the original page from. It ...
-
它是使用X509证书完成的。 SecurityTokenService (STS)使用其他服务信任的证书“签署SAML令牌”。 因此,使用常见的东西建立信任,即证书,STS和其他服务也信任! 在调用其他Web服务时,STS发出的SAML令牌通过SOAP头发送。 如果SAML令牌由您的其他服务信任的证书签名,则您的服务会理解该令牌是由“可信”STS颁发的。 在Windows Identity Foundation ,您可以为STS 配置签名证书 。 对于其他Web服务, 可以使用ServiceCredenti ...
-
为此,开发了公共对象请求代理体系结构(CORBA)。 但它对你的需求来说太大了。 我建议您使用某种REST或SOAP服务与转换器( 适配器模式 ) I have solved at my own. I don't know is it good practice or not. My answer is -> I have used JAXB for marshaling DeviceInformation class and used `void marshal(Object jaxbElement, W ...
-
我发现错误是什么并解决了它。 此错误的原因SSL端口(默认为443)未在服务器的防火墙上打开。 所以我联系服务公司.i给了我静态公共IP。 给了我访问权限 i found what the error is and solved it. the reason of this error SSL port (default is 443) is not open on server's firewall. so i contact the service company .i gave my static p ...
-
如果要使用https,则需要按照以下文档中的说明设置axis2.xml: http://axis.apache.org/axis2/java/core/docs/servlet-transport.html If you want to use https, then you need to set up axis2.xml as described in the following document: http://axis.apache.org/axis2/java/core/docs/servlet- ...
-
我得到服务器不返回此错误消息,在serviceCertificate的部分中添加以下内容
Tenemos estas opciones para que el servidor verifique la autenticidad del certificado emitido por e ... -
即使在禁用信任管理器后,也无法使用https Web服务(Error in consuming https web service even after disabling trust manager)[2022-04-19]
试试这段代码,它会在控制台中禁用和打印响应, String send = "https://www.example.com"; URL url = new URL(send); TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { public java.security.cert.X509Certificate[] getAccepte ... -
错误消息说明了这一切: The remote certificate is invalid according to the validation procedure. 您应该检查远程证书。 它可能已过期,或由某些不受信任的CA颁发。 如果您不关心证书是否无效,则可以在建立SSL连接之前在某处添加以下代码: ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate cert ...
-
post(url, data, [config]); 在数据部分中,您可以发送Json对象 data = { "name" : "Amit", "age" : 24 } 在您的情况下,如果您的textField模型是$ scope.textField,那么数据将是 - data = { "nomTipus" : $scope.textField } post(url, data, [config]); In data part you can send Json objects fo ...