현재 위치 - 중국 분류 정보 발표 플랫폼 - 비즈니스 서비스 정보 - Connectionconn = null;

Connectionconn = null;

//?

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 ();