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
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
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