- 無法使用executeQuery()發出數據處理 語句。在JSP中更新錯誤,eclipse
UPDATING Java代碼
MultiDBManager db8=new MultiDBManager(uif);
String updateString = "UPDATE pklrsc SET pr_prod_rate="+rate+" , pr_ln_cst="+cost+" WHERE pr_rsc_cde= "+component+" ";
db8.execSQL(updateString);
的.java文件代碼
public ResultSet execSQL(String sql) throws SQLException {
System.out.println("execSQL");
return super.execSQL(processQuery(sql));
}
private String processQuery(String sql){
System.out.println("processQuery");
return mdb.getCacheDB().procSQL(sql, false);
}
錯誤信息
value i: 1
component: ACODE0001
rate: 2.00
cost: 261.22
execSQL
processQuery
Execute = UPDATE c66_p30_BIS.pklrsc SET pr_prod_rate=2.00 , pr_ln_cst=261.22 WHERE pr_rsc_cde= ACODE0001
Nov 4, 2010 4:54:49 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.sql.SQLException: Can not issue data manipulation statements with executeQuery().
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.Statement.checkForDml(Statement.java:398)