jsp源程序:<% try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:ecn","","");
Statement stmt=conn.createStatement();
String account=request.getParameter("account");
String pwd=request.getParameter("pwd");
String sex=request.getParameter("sex");
String birthday=request.getParameter("birthday");
String email=request.getParameter("email");
String addr=request.getParameter("addr");
String phone=request.getParameter("phone");
String qq=request.getParameter("qq");
String sql="insert into user_info (account,pwd,sex,birthday,email,addr,phone,qq) values('"+account+"','"+pwd+"','"+sex+"','"+birthday+"','"+email+"','"+addr+"','"+phone+"','"+qq+"')"; stmt.executeUpdate(sql);
stmt.close(); conn.close();
response.sendRedirect("OK.jsp");
} catch(SQLException e){ out.println("SQL error");
}catch(ClassNotFoundException e){
out.println("CNF error");
} %>
在成功像数据库提交以后 回到数据库的表中看都是null 希望大家给予帮助 小弟先谢过了!
准确的说是:数据库中的表的记录增加了 但是每个字段对应的值都是null 困惑?