I have a question related to Java & mySQL.
I have a login and I want to extract some values from a row.
This is how my table looks like :

Once my login is successfull, I want to save into 2 variables the following : (My login works, I've just pasted the chunk of code where I have interest in)
The coins for the current logged int The privileges a user has in a String
In the main class I've declared the following
public static int coins;
public static String status;
This is the code :
String sqlQuery = "SELECT * FROM username WHERE username = ? and password = MD5(?)";
PreparedStatement pst = connect.prepareStatement( sqlQuery );
pst.setString( 1, Proiect_final.username );
pst.setString( 2, Proiect_final.pw );
// // Coins extraction !
// String sqlQuery1 = "SELECT coins,status FROM username WHERE username = ?";
// PreparedStatement pst1 = connect.prepareStatement(sqlQuery);
// pst1.setString(1, Proiect_final.username);
ResultSet rs = pst.executeQuery();
if( rs.next() ) {
coins = [?];
System.out.println("You did it!");
mainFrm abba = new mainFrm();
abba.setVisible(true);
}
I'd appreciate any help.
coins = rs.getInt("coins");