//?
Connectionconn = null;
Try{
//
String URL = "JDBC: MySQL://localhost: 3306/zhaohan";
//?
Stringuser = "루트";
Stringpassword = "123";
//
Class.forname ("com.mysql.jdbc.driver");
//
Conn = drivermanager.getconnection (URL, user, password);
}catch(Exception e){
System.out.println ("?"?" );
}
//
Prepared statement ST = conn.preparestatement ("insert into student (sname, pwd) values (? ,? ));
//?
St.setString(1, name);
St.setString(2, pwd);
//
Int I = st.executeupdate ();
//?
If(i gt;; 0){ //?
Request.getrequestdispatcher ("select.jsp"). forward (request, response);
}
//?
St.close ();
Conn.close ();