小编Saj*_*aju的帖子

使用Java为DB2和Oracle插入BLOB

我目前正在验证在Oracle for DB2上开发的应用程序.由于我们不想维护两个单独的源,因此我需要一些查询来将blob插入到字段中,这在oracle和db2中都有效.我没有任何标识符来区分运行应用程序的DB.

utl_raw.cast_to_raw 在oracle和CAST() as BLOBDB2中使用了互不兼容的东西.

java oracle db2 blob jdbc

6
推荐指数
1
解决办法
2万
查看次数

HttpURLConnection关闭IO流

我是Java和HttpURLConnection的新手.我应该在断开连接之前关闭打开的IO流.如果我关闭流,我是否还需要断开连接?哪种是正确的实施方式?

try {
String uri = "http://localhost:8081/RESTEASY/saju/post/text";
URL url = new URL(uri);
connection =
    (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Accept", "text/plain");
connection.setRequestProperty("Content-Type", "text/plain");
connection.setDoOutput(true);

OutputStream os = connection.getOutputStream();

//bla bla

System.out.println(connection.getResponseCode());
InputStream iStream = connection.getInputStream();

//bla bla

} catch (MalformedURLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
} catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}finally{
    // os.close(); - IS THIS REQUIRED
    // iStream.close(); - IS THIS REQUIRED
    connection.disconnect();    
}
}
Run Code Online (Sandbox Code Playgroud)

java sockets connection stream httpurlconnection

3
推荐指数
1
解决办法
6238
查看次数

Axis2:无法使用Rampart模块

尝试在Axis2中使用Rampart实现WS-Security时,我收到以下错误.

org.apache.axis2.AxisFault: Unable to engage module : rampart
at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:358)
Run Code Online (Sandbox Code Playgroud)

我在嵌入模式下使用轴(在我耳中).没有安全实现,服务正常工作.我已将该策略包含在services.xml中以及WSDL中.使用Jboss和JDK6请查看下面的文件.

Axis2.xml

<wsdl:definitions xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://service" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://service">
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service">
<xs:element name="echo">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="args0" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="echoResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="echoRequest">
<wsdl:part name="parameters" element="ns:echo"></wsdl:part>
</wsdl:message>
<wsdl:message name="echoResponse">
<wsdl:part name="parameters" element="ns:echoResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="SimpleServicePortType">
<wsdl:operation name="echo">
<wsdl:input message="ns:echoRequest" wsaw:Action="urn:echo"></wsdl:input>
<wsdl:output message="ns:echoResponse" wsaw:Action="urn:echoResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SimpleServiceSoap11Binding" …
Run Code Online (Sandbox Code Playgroud)

java ws-security axis2 web-services rampart

2
推荐指数
1
解决办法
7653
查看次数

RegEx检查字符串是否以特定字符开头和结尾

我需要一个正则表达式来检查字符串是否以特殊字符开头和结尾,如 -

%ASDF%

"ASDF"

@ASDF@
Run Code Online (Sandbox Code Playgroud)

java regex actionscript-3

1
推荐指数
1
解决办法
1万
查看次数

Flex arraycollection排序无法正常工作

我试图对存储在arraycollection中的字符串列表进行排序.但排序结果不正确.请看我的代码.

spark.collections.Sort

if(value is ArrayCollection){
            var sort:Sort=new Sort();
            var sortField:SortField = new SortField("data")
            sortField.numeric=false;
            sort.fields=[sortField];

            ArrayCollection(value).sort=sort;
            ArrayCollection(value).refresh();
        }
Run Code Online (Sandbox Code Playgroud)

输入:开始,包含,结束,等于IgnoreCase,不等于,匹配,等于

输出:等于IgnoreCase,包含,结束,开始,不等于,匹配,等于

有时候只有一行与另一行交换(如上所述),有些时候根本没有排序.

apache-flex sorting string actionscript-3 arraycollection

0
推荐指数
1
解决办法
3776
查看次数