I am no expert but this works for me.
Statement stmt = conn.createStatement();
ResultSet rest = stmt.executeQuery("select last_value from cid ");
int myint = rest.getInt(1);
bla bla bla again.....
on psql if you go type select * from mysequence;
you will see what variables you can access. I am not sure it is last_value or last
value or current value.
Hope this helps.
Felix Morley Finch wrote:
> I am a somewhat newbie with java and sql. I've run into something
> that seems odd, maybe even wrong (!).
> Statement seq = db.createStatement ();
> seq.execute ("SELECT nextval ('cdid')");
> ResultSet rs = seq.getResultSet ();
> id = rs.getInt (0 + 1); <=========
In response to
pgsql-interfaces by date
|Next:||From: Byron Nikolaidis||Date: 1998-05-10 00:12:21|
|Subject: Re: [INTERFACES] NEW ODBC DRIVER|
|Previous:||From: Stephen Davies||Date: 1998-05-09 02:17:25|
|Subject: New ODBC release|