linjyloo
Posts: 2
Nickname: mistella
Registered: Apr, 2005
|
|
Get insert record OID after inserting a record
|
Posted: Apr 15, 2005 10:54 PM
|
|
Advertisement
|
Good day everyone =)
I need to get inserted record OID once i insert a record into MySQL DB. below is my current code:
public int createRecord(Record record) throws SQLException{ String sql="insert into Record(name) values(?)"; PreparedStatement pstmt = con.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); pstmt.setString(1, record.getName()); int row=pstmt.executeUpdate(); pstmt.close(); return (-1); }
Table Record( OID int primary key auto increament, name varchar2(100) )
Anyone who know please advise me, thanks in advance ;)
|
|