public void upBlob(String sql,String xh,String zp,InputStream in)throws Exception{
List list = new ArrayList();
BLOB blob = null;
int i ;
try{
conn = db.getConnection("zfconnpool");
conn.setAutoCommit(false);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, xh);
rs = pstmt.executeQuery();
while(rs.next()){
blob = (oracle.sql.BLOB)rs.getBlob(zp);
}
OutputStream outstr = new BufferedOutputStream(blob.getBinaryOutputStream());
while((i = in.read())!=-1){
outstr.write(i);
}
in.close();
outstr.close();
conn.commit();
} catch (Exception e) {
e.printStackTrace();
list = null;
} finally{
rs.close();
pstmt.close();
conn.close();
}
List list = new ArrayList();
BLOB blob = null;
int i ;
try{
conn = db.getConnection("zfconnpool");
conn.setAutoCommit(false);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, xh);
rs = pstmt.executeQuery();
while(rs.next()){
blob = (oracle.sql.BLOB)rs.getBlob(zp);
}
OutputStream outstr = new BufferedOutputStream(blob.getBinaryOutputStream());
while((i = in.read())!=-1){
outstr.write(i);
}
in.close();
outstr.close();
conn.commit();
} catch (Exception e) {
e.printStackTrace();
list = null;
} finally{
rs.close();
pstmt.close();
conn.close();
}