mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Wed Jan 31 08:46:00 GMT 2001 peter@retep.org.uk
- Some minor additions to Statement to make our own extensions more portable. - Statement.close() will now call ResultSet.close() rather than just dissasociating with it.
This commit is contained in:
@ -90,7 +90,13 @@ public class Statement implements java.sql.Statement
|
||||
*/
|
||||
public void close() throws SQLException
|
||||
{
|
||||
result = null;
|
||||
// Force the ResultSet to close
|
||||
java.sql.ResultSet rs = getResultSet();
|
||||
if(rs!=null)
|
||||
rs.close();
|
||||
|
||||
// Disasociate it from us (For Garbage Collection)
|
||||
result = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -327,4 +333,18 @@ public class Statement implements java.sql.Statement
|
||||
return null;
|
||||
return ((org.postgresql.ResultSet)result).getStatusString();
|
||||
}
|
||||
|
||||
/**
|
||||
* New in 7.1: Returns the Last inserted oid. This should be used, rather
|
||||
* than the old method using getResultSet, which for executeUpdate returns
|
||||
* null.
|
||||
* @return OID of last insert
|
||||
*/
|
||||
public int getInsertedOID() throws SQLException
|
||||
{
|
||||
if(result!=null)
|
||||
return ((org.postgresql.ResultSet)result).getInsertedOID();
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user