我从注册表单中获取用户的用户名和密码,并将其保存在MS Access数据库中。当我这样做时,我的数据库中的密码列显示“null”。因此登录页面无法正常工作。我该怎么办?
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =DriverManager.getConnection("Jdbc:Odbc:db5");
Statement smt = con.createStatement();
String str =
"insert into table1(name1,sex,age,email,pwd,info) "
+ "values('" + name + "','" + sex + "','" + age + "','"
+ email + "','" + pwd + "','" + info + "')";
int val=smt.executeUpdate(str);
答案 0 :(得分:0)
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =DriverManager.getConnection("Jdbc:Odbc:db5");
Statement smt = con.createStatement();
String str =
"insert into table1(name1,sex,age,email,pwd,info) "
+ "values('" + name + "','" + sex + "','" + age + "','"
+ email + "','" + pwd + "','" + info + "')";
smt.executeUpdate(str);