极度郁闷,难道tomcat不支持createStatement, 都快被玩死啦,救救我吧
public ResultSet getResultSet(String strSql)
{
Connection conn = null;
try{
Class.forName("com.mysql.jdbc.Driver");
conn = java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/oost?user=root&password=&useUnicode=true&characterEncoding=8859_1");
if(conn!=null) System.out.println("Connection Successful!");
}catch(Exception e){
e.printStackTrace();
System.out.println("Error Trace in getConnection() : " + e.getMessage());
}
Statement stm;
ResultSet rs = null;
try
{
stm=conn.createStatement();
// rs = stm.executeQuery(strSql);
System.out.println("creteStatement Success");
}
catch (SQLException ex)
{
ex.printStackTrace();
System.out.println("dbTrans.executeQuery:"+ex.getMessage());
}
return rs;
}
以上代码用javac执行正常,在eclipse中调试正常,惟独是在浏览器里浏览一去到stm=conn.createStatement();
这句就出错,到底什么原因,救救我吧
环境:jdk1.502 + tomcat5.5