我目前正在验证在Oracle for DB2上开发的应用程序.由于我们不想维护两个单独的源,因此我需要一些查询来将blob插入到字段中,这在oracle和db2中都有效.我没有任何标识符来区分运行应用程序的DB.
我utl_raw.cast_to_raw 在oracle和CAST() as BLOBDB2中使用了互不兼容的东西.
我是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) 尝试在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) 我试图对存储在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,包含,结束,开始,不等于,匹配,等于
有时候只有一行与另一行交换(如上所述),有些时候根本没有排序.
java ×4
apache-flex ×1
axis2 ×1
blob ×1
connection ×1
db2 ×1
jdbc ×1
oracle ×1
rampart ×1
regex ×1
sockets ×1
sorting ×1
stream ×1
string ×1
web-services ×1
ws-security ×1