jsp页面得到input text输入的值来修改数据库不成功,求助!!
id是request.getParameter("")获取的另一个页面的,下面是<%java%>,都写在了一个jsp中,想实现修改;<%try{Class.forName...
id是 request.getParameter("")获取的另一个页面的,下面是<%java%>,都写在了一个jsp中,想实现修改;
<% try{
Class.forName(DRIVER);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
String id1=request.getParameter("id");
String user_name1=request.getParameter("user_name");
String user_pwd=request.getParameter("user_pwd");
String organization1=request.getParameter("organization");
Connection con = DriverManager.getConnection(URL,USER,PASS);
Statement stat =null;
ResultSet rs =null;
stat =con.createStatement();
String updateSql="update user set user_name="+user_name1+",user_pwd="+user_pwd+",organization="+organization1+"where id="+id1+"";
stat.execute(updateSql);
rs =stat.executeQuery("select * from user where id="+id1+"");
%>
submit 提交的完,数据库没改变,不知道什么原因。。求助!
百度了半天,不知道哪里错了,求好人指点 展开
<% try{
Class.forName(DRIVER);
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
String id1=request.getParameter("id");
String user_name1=request.getParameter("user_name");
String user_pwd=request.getParameter("user_pwd");
String organization1=request.getParameter("organization");
Connection con = DriverManager.getConnection(URL,USER,PASS);
Statement stat =null;
ResultSet rs =null;
stat =con.createStatement();
String updateSql="update user set user_name="+user_name1+",user_pwd="+user_pwd+",organization="+organization1+"where id="+id1+"";
stat.execute(updateSql);
rs =stat.executeQuery("select * from user where id="+id1+"");
%>
submit 提交的完,数据库没改变,不知道什么原因。。求助!
百度了半天,不知道哪里错了,求好人指点 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询