Answer the question
In order to leave comments, you need to log in
How can I get the SQLite result?
There is a code:
Connection cn = DriverManager.getConnection(road_to_DB);
Statment st = cn.createStatment();
//сам запрос:
if(st.executeQuery("SELECT * FROM users WHERE name = 'name'") == null) {
//TODO......
return;
}
Answer the question
In order to leave comments, you need to log in
Try like this:
ResultSet result = st.executeQuery("SELECT * FROM users WHERE name = 'name'");
if (!result.isBeforeFirst() ) {
// вернулось 0 строк
}
Returns:
true if the cursor is before the first row; false if the cursor is at any other position or the result set contains no rows
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question