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 17:43:39 GMT
> int recordCount = rs.getInt();
>
> I get compilation error on last line
>
> The method getInt(int) in the type ResultSet in not applicable for the
> arguments ()

Indeed, you have to specify the columnIndex.

http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html#getInt(int)

Specify getInt( 1 ), since there is one and only one
column in the query "select count(*) from..."

bryan


Mime
View raw message