return both user name and password
hi
I have small code
public String validateUser(String userId, String password)
throws SQLException, ClassNotFoundException{
String returnString =null;
Connection con=null;
//get free connection from pool
con =connectionPool.getConnection();
Statementstmt = con.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
String sql ="select password from users where Name='"+userId+"' and password='"+password+"'";
ResultSet rs = stmt.executeQuery(sql);
if (rs.next())
{
returnString = rs.getString("password");
}
connectionPool.returnConnection(con);
stmt.close();
con.close();
return returnString;
}
if I want to return both User Id and Password, How should I modify the code.
Thank you!

