Code:
Statement stmt = conn.createStatement();
// Obtain the generated key that results from the query.
stmt.executeUpdate("INSERT INTO authors " +
"(first_name, last_name) " +
"VALUES ('George', 'Orwell')",
Statement.RETURN_GENERATED_KEYS);
ResultSet rs = stmt.getGeneratedKeys();
if ( rs.next() ) {
// Retrieve the auto generated key(s).
int key = rs.getInt(1);
}
here is a code example of what i need ..
i can't find the getGeneratedKeys() method off the Statement object for the life of me. =/
is the jdbc version related to the j2sdk version ? i'm on 1.4.2