有关,jspsmart上传到Oracle数据库出错

mailguoyy 2003-10-20 05:58:42
CREATE TABLE TFILES (ID number(4) NOT NULL, FILENAME VARCHAR2(255), FILE1 BLOB, PRIMARY KEY (ID));
INSERT TABLE TFILES (ID,FILENAME,FILE1) VALUES (1,"test",null);
if ( FILE1!=null ){
// Connect to the database
//Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection con = ConnPool.getConnection();

// SQL Request
Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY ,ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("SELECT * FROM TFILES WHERE ID=1");

// if the resultset is not null
if (rs.next()){

// Initialization
mySmartUpload.initialize(pageContext);

// Upload
mySmartUpload.upload();

// upload file in the DB if this file is not missing
if (!mySmartUpload.getFiles().getFile(0).isMissing()){

try {

rs.updateString("FileName",mySmartUpload.getFiles().getFile(0).getFileName());
// Add the current file in the DB field
mySmartUpload.getFiles().getFile(0).fileToField(rs,"File1");
System.out.println("FILE1");

// Update
rs.updateRow();
count++;

} catch(Exception e) {
out.println("An error occurs : " + e.toString());
}

}

}

// Display the number of files uploaded
out.println(count + " file(s) uploaded in the database.");
}

An error occurs : java.sql.SQLException: ???????????: updateString 0 file(s) uploaded in the database.
...全文
36 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
mailguoyy 2003-10-21
  • 打赏
  • 举报
回复
up
mailguoyy 2003-10-21
  • 打赏
  • 举报
回复
大家帮忙看看啊
mailguoyy 2003-10-21
  • 打赏
  • 举报
回复
up,

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧