class="java" name="code">//操作Oracle数据库的时候,必须要用oracle自带的数据类型,Druid提供了通用方法,效率不错。 if (obj instanceof byte[]){ com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl cpi = new com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl(dds, cpc,null,(Long)object[0]); Blob blob = cpi.createBlob(); byte[] bin = (byte[])obj; blob.setBytes(bin.length, bin); ps.setBlob(i+1, blob); } else if (obj instanceof char[]){ Clob clob = new SerialClob((char[])obj); com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl cpi = new com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl(dds, cpc,null,(Long)object[0]); ClobProxy clobproxy = new ClobProxyImpl(dds,cpi , clob); ps.setClob(i+1, clobproxy.getCharacterStream()); }
?