I have a very basic MySQL Database. This is the query I used to create it:
CREATE TABLE SC_Users(
ID int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (ID),
Username varchar(255) NOT NULL,
Class varchar(255) NOT NULL
)
I get a ResultSet by querying my database with this:
SELECT * FROM SC_Users
I want to be able to search for a username and then find the corresponding class of that username. How would I do this without using a different query?
I know its possible to find it easily by using:
SELECT * FROM SC_Users WHERE `Username` = Username
But I would prefer to use only 1 query if possible to find any value of a user I want. Thanks in advance for the help!
ResultSet, then add all the values in aList<MyClass>only if they meet the conditions you need.