db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendleton.de...@gmail.com>
Subject Re: selecting records in a derby database
Date Sun, 20 Oct 2013 15:49:07 GMT
> rs = s.executeQuery("SELECT COUNT(*) FROM TABLE_NAME");
> int recordCount = ??????;

The query returned a result set.

Call next() on the result set to move to the first (and only)
row in the result set.

Then you can call getInt() to get the integer value of the
first (and only) column in that row.

Here's a good place to start with your learning:

http://docs.oracle.com/javase/tutorial/jdbc/basics/

thanks,

bryan



Mime
View raw message