为什么是空指针异常??
Oracle中数据表:
create table test(
id number(3) not null,
txt clob not null,
mvb blob not null,
img blob not null
);String txt=request.getParameter("txt");
String mvb=request.getParameter("mvb");
String img=request.getParameter("img");
File txtF=new File(txt);
File mvbF=new File(mvb);
File imgF=new File(img);
InputStream txtFile=new FileInputStream(txtF);
InputStream mvbFile=new FileInputStream(mvbF);
InputStream imgFile=new FileInputStream(imgF);
int txtlength=(int)txtF.length();
int mvblength=(int)mvbF.length();
int imglength=(int)imgF.length();
Connection conn = BaseDAO.getConnection(); 
PreparedStatement ps;
try {
ps = conn.prepareStatement("INSERT INTO Test VALUES(2,?,?,?)");
ps.setBinaryStream(1,txtFile,txtlength);
ps.setBinaryStream(2,mvbFile,mvblength);
ps.setBinaryStream(3,imgFile,imglength);
ps.execute();
conn.commit();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}