commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/test/org/apache/commons/dbcp TesterResultSet.java TesterStatement.java
Date Mon, 22 Dec 2003 14:59:43 GMT
dirkv       2003/12/22 06:59:43

  Modified:    dbcp/src/test/org/apache/commons/dbcp TesterResultSet.java
                        TesterStatement.java
  Log:
  Test* support for testing:
  Bugzilla Bug 24966: NullPointer with Oracle 9 driver
  wrong order of passivate/close when a rset isn't closed
  
  Revision  Changes    Path
  1.10      +5 -3      jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterResultSet.java
  
  Index: TesterResultSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterResultSet.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TesterResultSet.java	2 Nov 2003 17:46:12 -0000	1.9
  +++ TesterResultSet.java	22 Dec 2003 14:59:43 -0000	1.10
  @@ -123,6 +123,8 @@
       }
   
       public void close() throws SQLException {
  +        checkOpen();
  +        ((TesterStatement)_statement)._resultSet = null;
           _open = false;
       }
   
  
  
  
  1.13      +12 -4     jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterStatement.java
  
  Index: TesterStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TesterStatement.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TesterStatement.java	2 Nov 2003 17:46:12 -0000	1.12
  +++ TesterStatement.java	22 Dec 2003 14:59:43 -0000	1.13
  @@ -98,6 +98,7 @@
       protected int _fetchSize = 1;
       protected int _resultSetConcurrency = 1;
       protected int _resultSetType = 1;
  +    protected ResultSet _resultSet = null;
   
       public ResultSet executeQuery(String sql) throws SQLException {
           checkOpen();
  @@ -122,6 +123,10 @@
       public void close() throws SQLException {
           checkOpen();
           _open = false;
  +        if (_resultSet != null) {
  +            _resultSet.close();
  +            _resultSet = null;
  +        }
       }
   
       public int getMaxFieldSize() throws SQLException {
  @@ -184,7 +189,10 @@
   
       public ResultSet getResultSet() throws SQLException {
           checkOpen();
  -        return new TesterResultSet(this);
  +        if (_resultSet == null) {
  +            _resultSet = new TesterResultSet(this); 
  +        }
  +        return _resultSet;
       }
   
       public int getUpdateCount() throws SQLException {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message