当前位置: 技术问答>java相关
JBuilder 中的bean编译问题
来源: 互联网 发布时间:2015-11-20
本文导语: 代码: String sqlinsert="insert into book(name,author, language, content, category, commend,publish_name, publish_address, cdrom,price, good_price, book_number) Values( '"+name+"', '"+author+"', '"+language+"', '"+content+"', '"+category+"',' "+commend+"','"+publish_n...
代码:
String sqlinsert="insert into book(name,author, language, content, category, commend,publish_name, publish_address, cdrom,price, good_price, book_number) Values( '"+name+"', '"+author+"', '"+language+"', '"+content+"', '"+category+"',' "+commend+"','"+publish_name +"', '"+publish_address+"',' "+cdrom+"', '"+price+"', '"+good_price+"', '"+book_number+"')";
workM.executeQuery(sqlinsert);
出错行: workM.executeQuery(sqlinsert);
出错信息:
"post_ok.jsp": Error #: 300 : variable workM not found in class post_0005fok_0002ejsp_jsp at line 153
test.faq代码:
package test;
import java.sql.*;
public class faq {
//JDBC-ODBC 桥
String sDBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
String sConnStr = "jdbc:odbc:faq";
Connection conn = null;
ResultSet rs = null;
public faq() {
try {
Class.forName(sDBDriver);
}
catch(java.lang.ClassNotFoundException e) {
System.err.println(e.getMessage());
}
}
//定义public型函数
public ResultSet executeQuery(String sql) {
rs = null;
try {
conn = DriverManager.getConnection(sConnStr);
Statement stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
}
catch(SQLException ex) {
System.err.println("aq.executeQuery: " + ex.getMessage());
}
return rs;
}
}
谢谢!!
|
应为
java区分大小写