Connection connection=DriverManager.getConnection(url);
Statement Statement=conn.createStatement();
conn.close();
上面用connection
下面却用conn肯定错了啊
Statement Statement=connection.createStatement();
connection.close();
书籍,电影,音乐的互动交流平台http://www./
Connection connection=DriverManager.getConnection(url);
Statement Statement=conn.createStatement();
conn.close();
上面用connection
下面却用conn肯定错了啊
Statement Statement=connection.createStatement();
connection.close();
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn=DriverManager.getConnection(url);
catch(ClassNotFoundException ce){
out.print("异常:驱动连接错误");
}
//
try{
Statement st=conn.createStatement();
st.executeUpdate("INSERT into wode(numble,name,xing)values('numble','name')");
out.println("记录插入完毕!");
}
catch((SQLException sqle){
out.print("异常:"+sqle);
}
finally{
try{
if(st!=null) st.close();
if(conn!=null) conn.close();
}catch(Exception e){
out.print("异常:"+e);
}
}
你的 jsp文件编译错误。
Statement.executeUpdate(\"INSERT into wode(numble,name,xing)\" + \"values(\'numble\',\'name\')\");
out.println(\"记录插入完毕!\");
Statement.close();
conn.close();
你不觉得你的 "\"有点特别吗 。。都注释掉 代码了。。jsp没有 > 包括。。当然编译错误