I have send a code for your earlier Query, use that code and modify it. That code establishes a connection with the database, Provide a if condition to check whether the username and password is authenticated and then use the code:
stmt = con.createStatement();
rset = stmt.executeQuery ("SELECT * FROM Employee"); // Employee refers to table name
while (rset.next())
{
// get results
String client_no = rset.getString(1);
System.out.println("Name is "+client_no);
}
Regards,
Venkatesh