java - resultSet.updateRow() now how do i get the row/position curser at new row? -


i want find primary key of newly created row using resultset.updaterow()

i have tried

                rs.movetoinsertrow();                 rs.updatestring( 2, path );                 rs.insertrow();                 updated++;                 rs = ps.getgeneratedkeys();                 if (rs == null)return updated;//evals true                 rs.next();                  // want primary key                 id = rs.getint(1);  

also:

                rs.last()//no current row exception                 id = rs.getint(1); 

is there easy way or need create query?

and have created primary key column auto-generated? work if normal insert (not using updatable rs)?


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -