1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
public class WebServiceMediaISEP {
/**
* Web service operation
*/
@WebMethod(operationName = "inscription")
public String inscription(@WebParam(name = "login")
String login, @WebParam(name = "mdp")
String mdp, @WebParam(name = "mail")
String mail) {
try
{
Class.forName("com.mysql.jdbc.Driver" );
String url = "jdbc:mysql://localhost:3306/mediaisep";
String user = "root";
String passwd = "";
Connection conn = DriverManager.getConnection(url, user, passwd);
Statement state = conn.createStatement();
state.executeUpdate("INSERT INTO user(login,mdp,mail) VALUES ('"+ login +"','"+ mdp +"','"+ mail +"')");
return login;
}
catch (Exception e)
{
e.printStackTrace();
return "Erreur";
}
}
} |
Partager