Y
yps
Unregistered / Unconfirmed
GUEST, unregistred user!
我写的代码出错:
File file=new File("f://map.gif");
java.io.FileInputStream fileint=new FileInputStream(file);
int filelength=(int)file.length();
byte buffer[]=new byte[filelength];
fileint.read(buffer,0,filelength);
rs=st.executeQuery("select photo_bin1 from pmanage_employ");
rs.next();
oracle.sql.BLOB my_blob=(oracle.sql.BLOB)rs.getBlob(1);
my_blob.setBytes(buffer);
rs.close();
oracle.jdbc.OraclePreparedStatement ops = (oracle.jdbc.OraclePreparedStatement)conn.prepareStatement("update pmanage_employ set photo_bin=?");
ops.setBLOB(1, my_blob);
ops.executeUpdate();
提示:java.sql.SQLException: ORA-01461: 仅可以为插入 LONG 列的 LONG 值赋值
File file=new File("f://map.gif");
java.io.FileInputStream fileint=new FileInputStream(file);
int filelength=(int)file.length();
byte buffer[]=new byte[filelength];
fileint.read(buffer,0,filelength);
rs=st.executeQuery("select photo_bin1 from pmanage_employ");
rs.next();
oracle.sql.BLOB my_blob=(oracle.sql.BLOB)rs.getBlob(1);
my_blob.setBytes(buffer);
rs.close();
oracle.jdbc.OraclePreparedStatement ops = (oracle.jdbc.OraclePreparedStatement)conn.prepareStatement("update pmanage_employ set photo_bin=?");
ops.setBLOB(1, my_blob);
ops.executeUpdate();
提示:java.sql.SQLException: ORA-01461: 仅可以为插入 LONG 列的 LONG 值赋值