Answer the question
In order to leave comments, you need to log in
How to find out how many rows a query returned?
Hello, I wrote a simple program that should just find out how many records are in the database for a specific request, this is what I have:
public class Main {
public static void main(String[] args) {
try {
DriverManager.registerDriver(new Driver());
Connection c = DriverManager.getConnection("jdbc:mysql://host/dbname", "login", "pass");
Statement s = c.createStatement();
ResultSet rez = s.executeQuery("SELECT id FROM chel");
} catch (SQLException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question