Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @WebService()
- public class Name {
- @Resource(name = "DB")
- private DataSource DB;
- String pass1 = "";
- String mail = "";
- String q = "";
- String a = "";
- Statement statement = null;
- ResultSet rs = null;
- int updateQuery = 0;
- /**
- * Web service operation
- */
- @WebMethod
- public String hi(@WebParam(name = "name") String name, @WebParam(name = "sname") String sname) {
- try {
- Connection con = DB.getConnection();
- statement = con.createStatement();
- String query = "Select * from where CUST__NAME ="+name+"and CUST__SURNAME = "+sname;
- rs = statement.executeQuery(query);
- while(rs.next()){
- pass1 = rs.getString("CUST__PASS1");
- mail = rs.getString("CUST__MAIL");
- q = rs.getString("CUST__QUESTION");
- a = rs.getString("CUST__ANSWER");
- }
- rs.close();
- statement.close();
- con.close();
- } catch (SQLException ex) {
- ex.printStackTrace();
- }
- return "Hello "+name+" "+sname+ " Your password is "+pass1+ " and your e-mail is "+mail + ". Yout question is "+q+" and your answer is "+a;
- }
- }
Add Comment
Please, Sign In to add comment