[GENERAL] getting nextval from query?

2001-07-28 Thread G.L. Grobe
To create a primary key for one of my session beans within the ejbCreate(), I'm doing a the following.     ... query = "SELECT NEXTVAL('versions_seq')";   pstmt = dbConn.prepareStatement(query);   rs = pstmt.executeQuery();   rs.next(); nu

[GENERAL] diff's between creations of tables

2001-07-25 Thread G.L. Grobe
When creating an incremental and unique id, what are the benefits of using: CREATE TABLE tablename (colname SERIAL); instead of : CREATE SEQUENCE tablename_colname_seq; CREATE TABLE tablename (colname integer DEFAULT nextval('tablename_colname_seq'); CREATE UNIQUE INDEX tablename_colname_ke

[GENERAL] unique id's and incr

2001-07-23 Thread G.L. Grobe
During the creation of my database, I'm doing a:   CREATE UNIQUE INDEX account_idx ON Accounts (account_id);   to add new rows to my table and keep the id's unique.   During runtime (accessing by JDBC), is there anyway when adding a new row to a table to know the last id entry so as to incr