When i run a query with mysqlconnector
and fetching the result with ResulSet
my first is always with an null
before.
This my code:
Class.forName("com.mysql.jdbc.Driver");
conn =DriverManager.getConnection("jdbc:mysql://localhost/","","");
String query = "SELECT Category,Account FROM Settings" ;//
PreparedStatement select = conn.prepareStatement(query);
ResultSet rs = select.executeQuery( );
while (rs.next())
{
category += rs.getString("Category")+",";
account += rs.getString("Account")+",";
And my result is always: nullresult, result, result...
Even when its only one result it is always: nullResult
How can i fix this?