| Author |
maximum value of a column
|
lakshmanan anand
Greenhorn
Joined: Jan 13, 2009
Posts: 22
|
|
hi,
I am trying to add rows to a table (name : csv) whose schema is
ID Name Place
-- ------ --------
ResultSet res = stmt.executeQuery("select max(id) as id from csv");
int i = res.getInt("id");
i++;
i want to get the maximum value of ID . when i typed the above code, i get SQLException. what shall i do.
|
http://luckydev07.blogspot.com
|
 |
Chiranjeevi Kanthraj
Ranch Hand
Joined: Feb 18, 2008
Posts: 283
|
|
res.next();
you have to move the resultset to some specific location before doing get operation
|
-Chiru
|
 |
 |
|
|
subject: maximum value of a column
|
|
|