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
|
@WebMethod(operationName = "select")
public ArrayList select(@WebParam(name = "login")
String login, @WebParam(name = "pwd")
String pwd) {
ArrayList al= new ArrayList();
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con =
(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/Test",
"root", "");
ResultSet rs=st.executeQuery("select * from parametres where user like '%"+login+"%' and pwd like '%"+pwd+"%'");
while(rs.next())
{
parametres p=new parametres();
p.setIntCodeClient(rs.getInt("CodeClient"));
p.setstrLogin(rs.getString("user"));
p.setstrPwd(rs.getString("pwd"));
p.setstrMail(rs.getString("mail"));
p.setstrDebit(rs.getString("debit"));
p.setstrAdsl(rs.getString("adsl"));
p.setdatService(rs.getDate("DateServ"));
p.setIntTel(rs.getInt("Tel"));
al.add(p);
}
}
catch(Exception e)
{
e.printStackTrace();
}
return al;
}
} |
Partager