有关blob的问题
PreparedStatement pstmt=conn.prepareStatement("insert into tmp(c1,c2)values(?,EMPTY_BLOB())");
File tmpfile=new File("f:\\hello.java");
boolean b=false;
b=tmpfile.exists();
System.out.println(b);
int flen=(int)tmpfile.length();
FileInputStream fin=new FileInputStream(tmpfile);
pstmt.setString(1,"123");
pstmt.setBinaryStream(2,fin,flen);
pstmt.executeUpdate();
b输出的值是true.
但在执行pstmt.executeUpdate();时出错:
java.sql.SQLException: ORA-01006: 赋值变量不存在
这是什么意思,请各位大虾帮忙!
tmp表的c1:varchar2类型;c2:blob