0

我在注册表单中从用户那里获取用户名和密码,并将其保存在 MS 访问数据库中。当我这样做时,我的数据库中的密码列显示“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);
4

1 回答 1

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);
于 2012-10-27T09:06:15.947 回答