1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-17 06:41:09 +03:00

Tue Jan 30 22:24:00 GMT 2001 peter@retep.org.uk

- Fixed bug where Statement.setMaxRows() was a global setting. Now
          limited to just itself.
        - Changed LargeObject.read(byte[],int,int) to return the actual number
          of bytes read (used to be void).
        - LargeObject now supports InputStream's!
        - PreparedStatement.setBinaryStream() now works!
        - ResultSet.getBinaryStream() now returns an InputStream that doesn't
          copy the blob into memory first!
        - Connection.isClosed() now tests to see if the connection is still alive
          rather than if it thinks it's alive.
This commit is contained in:
Peter Mount
2001-01-31 08:26:02 +00:00
parent dca0762efc
commit 8439a83d84
12 changed files with 442 additions and 97 deletions

View File

@ -32,6 +32,7 @@ public class Statement implements java.sql.Statement
private Vector batch=null;
int resultsettype; // the resultset type to return
int concurrency; // is it updateable or not?
int maxrows=0; // the maximum number of rows to return 0=unlimited
/**
* Constructor for a Statement. It simply sets the connection
@ -134,7 +135,7 @@ public class Statement implements java.sql.Statement
*/
public int getMaxRows() throws SQLException
{
return connection.maxrows;
return maxrows;
}
/**
@ -146,7 +147,7 @@ public class Statement implements java.sql.Statement
*/
public void setMaxRows(int max) throws SQLException
{
connection.maxrows = max;
maxrows = max;
}
/**
@ -274,7 +275,8 @@ public class Statement implements java.sql.Statement
if(escapeProcessing)
sql=connection.EscapeSQL(sql);
result = connection.ExecSQL(sql);
// New in 7.1, pass Statement so that ExecSQL can customise to it
result = connection.ExecSQL(sql,this);
// New in 7.1, required for ResultSet.getStatement() to work
((org.postgresql.jdbc2.ResultSet)result).setStatement(this);
@ -388,11 +390,6 @@ public class Statement implements java.sql.Statement
throw org.postgresql.Driver.notImplemented();
}
//public int getKeysetSize() throws SQLException
//{
// throw org.postgresql.Driver.notImplemented();
//}
public int getResultSetConcurrency() throws SQLException
{
// new in 7.1
@ -415,11 +412,6 @@ public class Statement implements java.sql.Statement
throw org.postgresql.Driver.notImplemented();
}
//public void setKeysetSize(int keys) throws SQLException
//{
// throw org.postgresql.Driver.notImplemented();
//}
public void setResultSetConcurrency(int value) throws SQLException
{
concurrency=value;
@ -430,4 +422,17 @@ public class Statement implements java.sql.Statement
resultsettype=value;
}
/**
* 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;
}
}