中间有一部分是这样的刚才发错了
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url = "jdbc:mysql://localhost/mydb";
con = DriverManager.getConnection(url,"root","1234");
//sm = com.createStatement();
psm = con.prepareStatement("insert into users values(?,?,?,?,?,?)");
psm.setString(1,ID);
psm.setString(2,password);
psm.setString(3,name);
psm.setString(4,sex);
psm.setLong(5,getDate(date));
psm.setString(6,description);
psm.executeUpdate();
session.setAttribute("user",ID);
response.sendRedirect("index.jsp");
}
catch(Exception e){
//response.sendRedirect("register.jsp");
out.println("!connection error!");
out.println(getDate(date));
}
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url = "jdbc:mysql://localhost/mydb";
con = DriverManager.getConnection(url,"root","1234");
//sm = com.createStatement();
psm = con.prepareStatement("insert into users values(?,?,?,?,?,?)");
psm.setString(1,ID);
psm.setString(2,password);
psm.setString(3,name);
psm.setString(4,sex);
psm.setLong(5,getDate(date));
psm.setString(6,description);
psm.executeUpdate();
session.setAttribute("user",ID);
response.sendRedirect("index.jsp");
}
catch(Exception e){
//response.sendRedirect("register.jsp");
out.println("!connection error!");
out.println(getDate(date));
}
有需要者登录http://xdqbysj.10mb.cn/
QQ:
客服一(16376208) 客服二(57293694)