[求助]数据库的问题insert语句
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=user_db";
String user="sa";
String password="admin";
Connection conn=DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement();
String sql="insert into message(name) values('"+name+"')";
stmt.executeQuery(sql);
stmt.close();
conn.close();
但就是插不到数据库中去,报错是:
javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC]No ResultSet set was produced.
哪位高手给指点一下
[此贴子已经被作者于2006-3-17 13:15:02编辑过]