commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r734378 - in /commons/proper/dbcp/trunk: ./ src/java/org/apache/commons/dbcp/ src/java/org/apache/commons/dbcp/cpdsadapter/ src/java/org/apache/commons/dbcp/datasources/ src/test/org/apache/commons/dbcp/ src/test/org/apache/commons/dbcp/dat...
Date Wed, 14 Jan 2009 13:05:10 GMT
Author: markt
Date: Wed Jan 14 05:04:24 2009
New Revision: 734378

URL: http://svn.apache.org/viewvc?rev=734378&view=rev
Log:
Fix https://issues.apache.org/jira/browse/DBCP-191
Enabled DBCP to build on a 1.6 JDK
Patch provided by Michael Heuer

Modified:
    commons/proper/dbcp/trunk/build.xml
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingConnection.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingResultSet.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingStatement.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/ConnectionImpl.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterCallableStatement.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterConnection.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterPreparedStatement.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterResultSet.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterStatement.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/PooledConnectionProxy.java

Modified: commons/proper/dbcp/trunk/build.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/build.xml?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/build.xml (original)
+++ commons/proper/dbcp/trunk/build.xml Wed Jan 14 05:04:24 2009
@@ -70,10 +70,10 @@
       <property name="javac.optimize" value="false"/>
       <property name="javac.debug" value="true"/>
       <property name="javac.deprecation" value="false"/>
-      <property name="javac.source" value="1.4" />
 
       <available property="jndi.present" classname="javax.naming.Context"/>
       <available property="jdbc3.present" classname="java.sql.Savepoint"/>
+      <available property="jdbc4.present" classname="java.sql.Wrapper"/>
    </target>
 
    <!-- ######################################################### -->
@@ -110,7 +110,36 @@
       <property name="src.test.dir" value="${src.dir}/test"/>
    </target>
 
-   <target name="prepare" depends="init,prepare-nojdbc3,prepare-jdbc3"/>
+   <target name="prepare-nojdbc4" depends="init" unless="jdbc4.present">
+      <echo message="Commenting out the jdbc4 additional methods since JDBC 4 was not detected."/>
+      <property name="src.dir" value="${build.dir}/src"/>
+      <property name="src.java.dir" value="${src.dir}/java"/>
+      <property name="src.test.dir" value="${src.dir}/test"/>
+      <property name="javac.source" value="1.4" />
+
+      <mkdir dir="${src.dir}"/>
+      <copy todir="${src.dir}" filtering="yes">
+         <fileset dir="${basedir}/src" defaultexcludes="no">
+            <include name="**/*.java"/>
+            <include name="**/*.xml"/>
+            <include name="**/*.properties"/>
+            <include name="**/*.jocl"/>
+            <include name="**/package.html"/>
+         </fileset>
+      </copy>
+      <replace dir="${src.dir}" token="/* JDBC_4_ANT_KEY_BEGIN */" value="/*"/>
+      <replace dir="${src.dir}" token="/* JDBC_4_ANT_KEY_END */" value="*/"/>
+   </target>
+
+   <target name="prepare-jdbc4" depends="init" if="jdbc4.present">
+      <echo message="JDBC 4 was detected."/>
+      <property name="src.dir" value="${basedir}/src"/>
+      <property name="src.java.dir" value="${src.dir}/java"/>
+      <property name="src.test.dir" value="${src.dir}/test"/>
+      <property name="javac.source" value="1.5" />
+   </target>
+
+   <target name="prepare" depends="init,prepare-nojdbc3,prepare-jdbc3,prepare-nojdbc4,prepare-jdbc4"/>
 
    <target name="javadoc" depends="prepare" description="generates javadocs">
       <mkdir dir="${javadoc.dir}"/>

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java Wed Jan 14 05:04:24 2009
@@ -1162,6 +1162,15 @@
         return closed;
     }
 
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        return false;
+    }
+
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        throw new SQLException("BasicDataSource is not a wrapper.");
+    }
+
+        
     // ------------------------------------------------------ Protected Methods
 
 

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java Wed Jan 14 05:04:24 2009
@@ -32,6 +32,11 @@
 import java.io.InputStream;
 import java.io.Reader;
 import java.sql.SQLException;
+/* JDBC_4_ANT_KEY_BEGIN */
+import java.sql.NClob;
+import java.sql.RowId;
+import java.sql.SQLXML;
+/* JDBC_4_ANT_KEY_END */
 
 /**
  * A base delegating implementation of {@link CallableStatement}.
@@ -332,6 +337,337 @@
 
     public URL getURL(String parameterName) throws SQLException
     { checkOpen(); try { return _stmt.getURL(parameterName); } catch (SQLException e) { handleException(e); return null; } }
-
 /* JDBC_3_ANT_KEY_END */
+/* JDBC_4_ANT_KEY_BEGIN */
+
+    public RowId getRowId(int parameterIndex) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getRowId(parameterIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public RowId getRowId(String parameterName) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getRowId(parameterName);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public void setRowId(String parameterName, RowId value) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setRowId(parameterName, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNString(String parameterName, String value) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNString(parameterName, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNCharacterStream(String parameterName, Reader reader, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNCharacterStream(parameterName, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNClob(String parameterName, NClob value) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNClob(parameterName, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setClob(String parameterName, Reader reader, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setClob(parameterName, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setBlob(parameterName, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNClob(parameterName, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public NClob getNClob(int parameterIndex) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getNClob(parameterIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public NClob getNClob(String parameterName) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getNClob(parameterName);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public void setSQLXML(String parameterName, SQLXML value) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setSQLXML(parameterName, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public SQLXML getSQLXML(int parameterIndex) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getSQLXML(parameterIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public SQLXML getSQLXML(String parameterName) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getSQLXML(parameterName);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public String getNString(int parameterIndex) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getNString(parameterIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public String getNString(String parameterName) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getNString(parameterName);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public Reader getNCharacterStream(int parameterIndex) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getNCharacterStream(parameterIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public Reader getNCharacterStream(String parameterName) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getNCharacterStream(parameterName);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public Reader getCharacterStream(int parameterIndex) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getCharacterStream(parameterIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public Reader getCharacterStream(String parameterName) throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.getCharacterStream(parameterName);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public void setBlob(String parameterName, Blob blob) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setBlob(parameterName, blob);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setClob(String parameterName, Clob clob) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setClob(parameterName, clob);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setAsciiStream(String parameterName, InputStream inputStream, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setAsciiStream(parameterName, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setBinaryStream(String parameterName, InputStream inputStream, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setBinaryStream(parameterName, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setCharacterStream(parameterName, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setAsciiStream(String parameterName, InputStream inputStream) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setAsciiStream(parameterName, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setBinaryStream(String parameterName, InputStream inputStream) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setBinaryStream(parameterName, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setCharacterStream(parameterName, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNCharacterStream(String parameterName, Reader reader) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNCharacterStream(parameterName, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setClob(String parameterName, Reader reader) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setClob(parameterName, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }    }
+
+    public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setBlob(parameterName, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }    }
+
+    public void setNClob(String parameterName, Reader reader) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNClob(parameterName, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingConnection.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingConnection.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingConnection.java Wed Jan 14 05:04:24 2009
@@ -26,6 +26,19 @@
 import java.sql.Statement;
 import java.util.List;
 import java.util.Map;
+/* JDBC_4_ANT_KEY_BEGIN */
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.ClientInfoStatus;
+import java.sql.Clob;
+import java.sql.NClob;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLXML;
+import java.sql.Struct;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Properties;
+/* JDBC_4_ANT_KEY_END */
 
 /**
  * A base delegating implementation of {@link Connection}.
@@ -50,6 +63,12 @@
  */
 public class DelegatingConnection extends AbandonedTrace
         implements Connection {
+
+/* JDBC_4_ANT_KEY_BEGIN */
+    private static final Map<String, ClientInfoStatus> EMPTY_FAILED_PROPERTIES =
+        Collections.<String, ClientInfoStatus>emptyMap();
+/* JDBC_4_ANT_KEY_END */
+
     /** My delegate {@link Connection}. */
     protected Connection _conn = null;
 
@@ -498,4 +517,139 @@
         }
     }
 /* JDBC_3_ANT_KEY_END */
+/* JDBC_4_ANT_KEY_BEGIN */
+
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        return _conn.isWrapperFor(iface);
+    }
+
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        return _conn.unwrap(iface);
+    }
+
+    public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
+        checkOpen();
+        try {
+            return _conn.createArrayOf(typeName, elements);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public Blob createBlob() throws SQLException {
+        checkOpen();
+        try {
+            return _conn.createBlob();
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public Clob createClob() throws SQLException {
+        checkOpen();
+        try {
+            return _conn.createClob();
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public NClob createNClob() throws SQLException {
+        checkOpen();
+        try {
+            return _conn.createNClob();
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public SQLXML createSQLXML() throws SQLException {
+        checkOpen();
+        try {
+            return _conn.createSQLXML();
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
+        checkOpen();
+        try {
+            return _conn.createStruct(typeName, attributes);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public boolean isValid(int timeout) throws SQLException {
+        checkOpen();
+        try {
+            return _conn.isValid(timeout);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return false;
+        }
+    }
+
+    public void setClientInfo(String name, String value) throws SQLClientInfoException {
+        try {
+            checkOpen();
+            _conn.setClientInfo(name, value);
+        }
+        catch (SQLClientInfoException e) {
+            throw e;
+        }
+        catch (SQLException e) {
+            throw new SQLClientInfoException("Connection is closed.", EMPTY_FAILED_PROPERTIES, e);
+        }
+    }
+
+    public void setClientInfo(Properties properties) throws SQLClientInfoException {
+        try {
+            checkOpen();
+            _conn.setClientInfo(properties);
+        }
+        catch (SQLClientInfoException e) {
+            throw e;
+        }
+        catch (SQLException e) {
+            throw new SQLClientInfoException("Connection is closed.", EMPTY_FAILED_PROPERTIES, e);
+        }
+    }
+
+    public Properties getClientInfo() throws SQLException {
+        checkOpen();
+        try {
+            return _conn.getClientInfo();
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public String getClientInfo(String name) throws SQLException {
+        checkOpen();
+        try {
+            return _conn.getClientInfo(name);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java Wed Jan 14 05:04:24 2009
@@ -27,6 +27,13 @@
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.util.Calendar;
+/* JDBC_4_ANT_KEY_BEGIN */
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.NClob;
+import java.sql.RowId;
+import java.sql.SQLXML;
+/* JDBC_4_ANT_KEY_END */
 
 /**
  * A base delegating implementation of {@link PreparedStatement}.
@@ -221,6 +228,187 @@
 
     public java.sql.ParameterMetaData getParameterMetaData() throws SQLException
     { checkOpen(); try { return _stmt.getParameterMetaData(); } catch (SQLException e) { handleException(e); return null; } }
-
 /* JDBC_3_ANT_KEY_END */
+/* JDBC_4_ANT_KEY_BEGIN */
+
+    public void setRowId(int parameterIndex, RowId value) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setRowId(parameterIndex, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNString(int parameterIndex, String value) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNString(parameterIndex, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNCharacterStream(parameterIndex, value, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNClob(int parameterIndex, NClob value) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNClob(parameterIndex, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setClob(parameterIndex, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setBlob(parameterIndex, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNClob(parameterIndex, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setSQLXML(int parameterIndex, SQLXML value) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setSQLXML(parameterIndex, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setAsciiStream(int parameterIndex, InputStream inputStream, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setAsciiStream(parameterIndex, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setBinaryStream(int parameterIndex, InputStream inputStream, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setBinaryStream(parameterIndex, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setCharacterStream(parameterIndex, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setAsciiStream(int parameterIndex, InputStream inputStream) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setAsciiStream(parameterIndex, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setBinaryStream(int parameterIndex, InputStream inputStream) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setBinaryStream(parameterIndex, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setCharacterStream(parameterIndex, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNCharacterStream(int parameterIndex, Reader reader) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNCharacterStream(parameterIndex, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setClob(int parameterIndex, Reader reader) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setClob(parameterIndex, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setBlob(parameterIndex, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void setNClob(int parameterIndex, Reader reader) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setNClob(parameterIndex, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingResultSet.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingResultSet.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingResultSet.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingResultSet.java Wed Jan 14 05:04:24 2009
@@ -34,6 +34,11 @@
 import java.sql.Clob;
 import java.sql.Array;
 import java.util.Calendar;
+/* JDBC_4_ANT_KEY_BEGIN */
+import java.sql.NClob;
+import java.sql.RowId;
+import java.sql.SQLXML;
+/* JDBC_4_ANT_KEY_END */
 
 /**
  * A base delegating implementation of {@link ResultSet}.
@@ -585,6 +590,459 @@
 
     public void updateArray(String columnName, java.sql.Array x) throws SQLException
     { try { _res.updateArray(columnName, x); } catch (SQLException e) { handleException(e); } }
-
 /* JDBC_3_ANT_KEY_END */
+/* JDBC_4_ANT_KEY_BEGIN */
+
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        return _res.isWrapperFor(iface);
+    }
+
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        return _res.unwrap(iface);
+    }
+
+    public RowId getRowId(int columnIndex) throws SQLException {
+        try {
+            return _res.getRowId(columnIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public RowId getRowId(String columnLabel) throws SQLException {
+        try {
+            return _res.getRowId(columnLabel);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public void updateRowId(int columnIndex, RowId value) throws SQLException {
+        try {
+            _res.updateRowId(columnIndex, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateRowId(String columnLabel, RowId value) throws SQLException {
+        try {
+            _res.updateRowId(columnLabel, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public int getHoldability() throws SQLException {
+        try {
+            return _res.getHoldability();
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return 0;
+        }
+    }
+
+    public boolean isClosed() throws SQLException {
+        try {
+            return _res.isClosed();
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return false;
+        }
+    }
+
+    public void updateNString(int columnIndex, String value) throws SQLException {
+        try {
+            _res.updateNString(columnIndex, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateNString(String columnLabel, String value) throws SQLException {
+        try {
+            _res.updateNString(columnLabel, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateNClob(int columnIndex, NClob value) throws SQLException {
+        try {
+            _res.updateNClob(columnIndex, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateNClob(String columnLabel, NClob value) throws SQLException {
+        try {
+            _res.updateNClob(columnLabel, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public NClob getNClob(int columnIndex) throws SQLException {
+        try {
+            return _res.getNClob(columnIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public NClob getNClob(String columnLabel) throws SQLException {
+        try {
+            return _res.getNClob(columnLabel);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public SQLXML getSQLXML(int columnIndex) throws SQLException {
+        try {
+            return _res.getSQLXML(columnIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public SQLXML getSQLXML(String columnLabel) throws SQLException {
+        try {
+            return _res.getSQLXML(columnLabel);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public void updateSQLXML(int columnIndex, SQLXML value) throws SQLException {
+        try {
+            _res.updateSQLXML(columnIndex, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateSQLXML(String columnLabel, SQLXML value) throws SQLException {
+        try {
+            _res.updateSQLXML(columnLabel, value);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public String getNString(int columnIndex) throws SQLException {
+        try {
+            return _res.getNString(columnIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public String getNString(String columnLabel) throws SQLException {
+        try {
+            return _res.getNString(columnLabel);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public Reader getNCharacterStream(int columnIndex) throws SQLException {
+        try {
+            return _res.getNCharacterStream(columnIndex);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public Reader getNCharacterStream(String columnLabel) throws SQLException {
+        try {
+            return _res.getNCharacterStream(columnLabel);
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return null;
+        }
+    }
+
+    public void updateNCharacterStream(int columnIndex, Reader reader, long length) throws SQLException {
+        try {
+            _res.updateNCharacterStream(columnIndex, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
+        try {
+            _res.updateNCharacterStream(columnLabel, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateAsciiStream(int columnIndex, InputStream inputStream, long length) throws SQLException {
+        try {
+            _res.updateAsciiStream(columnIndex, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateBinaryStream(int columnIndex, InputStream inputStream, long length) throws SQLException {
+        try {
+            _res.updateBinaryStream(columnIndex, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateCharacterStream(int columnIndex, Reader reader, long length) throws SQLException {
+        try {
+            _res.updateCharacterStream(columnIndex, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateAsciiStream(String columnLabel, InputStream inputStream, long length) throws SQLException {
+        try {
+            _res.updateAsciiStream(columnLabel, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateBinaryStream(String columnLabel, InputStream inputStream, long length) throws SQLException {
+        try {
+            _res.updateBinaryStream(columnLabel, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
+        try {
+            _res.updateCharacterStream(columnLabel, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
+        try {
+            _res.updateBlob(columnIndex, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
+        try {
+            _res.updateBlob(columnLabel, inputStream, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
+        try {
+            _res.updateClob(columnIndex, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
+        try {
+            _res.updateClob(columnLabel, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
+        try {
+            _res.updateNClob(columnIndex, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
+        try {
+            _res.updateNClob(columnLabel, reader, length);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateNCharacterStream(int columnIndex, Reader reader) throws SQLException {
+        try {
+            _res.updateNCharacterStream(columnIndex, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
+        try {
+            _res.updateNCharacterStream(columnLabel, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateAsciiStream(int columnIndex, InputStream inputStream) throws SQLException {
+        try {
+            _res.updateAsciiStream(columnIndex, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateBinaryStream(int columnIndex, InputStream inputStream) throws SQLException {
+        try {
+            _res.updateBinaryStream(columnIndex, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateCharacterStream(int columnIndex, Reader reader) throws SQLException {
+        try {
+            _res.updateCharacterStream(columnIndex, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateAsciiStream(String columnLabel, InputStream inputStream) throws SQLException {
+        try {
+            _res.updateAsciiStream(columnLabel, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateBinaryStream(String columnLabel, InputStream inputStream) throws SQLException {
+        try {
+            _res.updateBinaryStream(columnLabel, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
+        try {
+            _res.updateCharacterStream(columnLabel, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
+        try {
+            _res.updateBlob(columnIndex, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
+        try {
+            _res.updateBlob(columnLabel, inputStream);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateClob(int columnIndex, Reader reader) throws SQLException {
+        try {
+            _res.updateClob(columnIndex, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateClob(String columnLabel, Reader reader) throws SQLException {
+        try {
+            _res.updateClob(columnLabel, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateNClob(int columnIndex, Reader reader) throws SQLException {
+        try {
+            _res.updateNClob(columnIndex, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public void updateNClob(String columnLabel, Reader reader) throws SQLException {
+        try {
+            _res.updateNClob(columnLabel, reader);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingStatement.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingStatement.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingStatement.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/DelegatingStatement.java Wed Jan 14 05:04:24 2009
@@ -128,10 +128,6 @@
 
     protected boolean _closed = false;
 
-    protected boolean isClosed() {
-        return _closed;
-    }
-
     protected void checkOpen() throws SQLException {
         if(isClosed()) {
             throw new SQLException
@@ -346,4 +342,39 @@
     { checkOpen(); try { return _stmt.getResultSetHoldability(); } catch (SQLException e) { handleException(e); return 0; } }
 
 /* JDBC_3_ANT_KEY_END */
+/* JDBC_4_ANT_KEY_BEGIN */
+
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        return _conn.isWrapperFor(iface);
+    }
+
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        return _conn.unwrap(iface);
+    }
+
+    public boolean isClosed() throws SQLException {
+        return _closed;
+    }
+
+    public void setPoolable(boolean poolable) throws SQLException {
+        checkOpen();
+        try {
+            _stmt.setPoolable(poolable);
+        }
+        catch (SQLException e) {
+            handleException(e);
+        }
+    }
+
+    public boolean isPoolable() throws SQLException {
+        checkOpen();
+        try {
+            return _stmt.isPoolable();
+        }
+        catch (SQLException e) {
+            handleException(e);
+            return false;
+        }
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingDataSource.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingDataSource.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingDataSource.java Wed Jan 14 05:04:24 2009
@@ -84,6 +84,14 @@
     public void setAccessToUnderlyingConnectionAllowed(boolean allow) {
         this.accessToUnderlyingConnectionAllowed = allow;
     }
+
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        return false;
+    }
+
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        throw new SQLException("PoolingDataSource is not a wrapper.");
+    }
     
     //--- DataSource methods -----------------------------------------
 

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/ConnectionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/ConnectionImpl.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/ConnectionImpl.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/ConnectionImpl.java Wed Jan 14 05:04:24 2009
@@ -25,6 +25,19 @@
 import java.sql.Statement;
 import java.sql.SQLWarning;
 import java.sql.SQLException;
+/* JDBC_4_ANT_KEY_BEGIN */
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.ClientInfoStatus;
+import java.sql.Clob;
+import java.sql.NClob;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLXML;
+import java.sql.Struct;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Properties;
+/* JDBC_4_ANT_KEY_END */
 
 /**
  * This class is the <code>Connection</code> that will be returned
@@ -42,6 +55,11 @@
     private static final String CLOSED 
             = "Attempted to use Connection after closed() was called.";
 
+/* JDBC_4_ANT_KEY_BEGIN */
+    private static final Map<String, ClientInfoStatus> EMPTY_FAILED_PROPERTIES =
+        Collections.<String, ClientInfoStatus>emptyMap();
+/* JDBC_4_ANT_KEY_END */
+
     /** The JDBC database connection. */
     private Connection connection;
 
@@ -453,6 +471,86 @@
         assertOpen();
         return connection.prepareStatement(sql, columnNames);
     }
-
 /* JDBC_3_ANT_KEY_END */
+/* JDBC_4_ANT_KEY_BEGIN */
+
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        return connection.isWrapperFor(iface);
+    }
+
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        return connection.unwrap(iface);
+    }
+
+    public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
+        assertOpen();
+        return connection.createArrayOf(typeName, elements);
+    }
+
+    public Blob createBlob() throws SQLException {
+        assertOpen();
+        return connection.createBlob();
+    }
+
+    public Clob createClob() throws SQLException {
+        assertOpen();
+        return connection.createClob();
+    }
+
+    public NClob createNClob() throws SQLException {
+        assertOpen();
+        return connection.createNClob();
+    }
+
+    public SQLXML createSQLXML() throws SQLException {
+        assertOpen();
+        return connection.createSQLXML();
+    }
+
+    public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
+        assertOpen();
+        return connection.createStruct(typeName, attributes);
+    }
+
+    public boolean isValid(int timeout) throws SQLException {
+        assertOpen();
+        return connection.isValid(timeout);
+    }
+
+    public void setClientInfo(String name, String value) throws SQLClientInfoException {
+        try {
+            assertOpen();
+            connection.setClientInfo(name, value);
+        }
+        catch (SQLClientInfoException e) {
+            throw e;
+        }
+        catch (SQLException e) {
+            throw new SQLClientInfoException("Connection is closed.", EMPTY_FAILED_PROPERTIES, e);
+        }
+    }
+
+    public void setClientInfo(Properties properties) throws SQLClientInfoException {
+        try {
+            assertOpen();
+            connection.setClientInfo(properties);
+        }
+        catch (SQLClientInfoException e) {
+            throw e;
+        }
+        catch (SQLException e) {
+            throw new SQLClientInfoException("Connection is closed.", EMPTY_FAILED_PROPERTIES, e);
+        }
+    }
+
+    public Properties getClientInfo() throws SQLException {
+        assertOpen();
+        return connection.getClientInfo();
+    }
+
+    public String getClientInfo(String name) throws SQLException {
+        assertOpen();
+        return connection.getClientInfo(name);
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java Wed Jan 14 05:04:24 2009
@@ -26,6 +26,7 @@
 import javax.sql.ConnectionEvent;
 import javax.sql.ConnectionEventListener;
 import javax.sql.PooledConnection;
+import javax.sql.StatementEventListener;
 
 import org.apache.commons.dbcp.DelegatingConnection;
 import org.apache.commons.dbcp.DelegatingPreparedStatement;
@@ -66,6 +67,11 @@
     private Vector eventListeners;
 
     /**
+     * StatementEventListeners
+     */
+    private Vector statementEventListeners;
+
+    /**
      * flag set to true, once close() is called.
      */
     boolean isClosed;
@@ -101,6 +107,12 @@
         }
     }
 
+    public void addStatementEventListener(StatementEventListener listener) {
+        if (!statementEventListeners.contains(listener)) {
+            statementEventListeners.add(listener);
+        }
+    }
+
     /**
      * Closes the physical connection and marks this 
      * <code>PooledConnection</code> so that it may not be used 
@@ -169,6 +181,10 @@
         eventListeners.remove(listener);
     }
 
+    public void removeStatementEventListener(StatementEventListener listener) {
+        statementEventListeners.remove(listener);
+    }
+
     /**
      * Closes the physical connection and checks that the logical connection
      * was closed as well.

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java Wed Jan 14 05:04:24 2009
@@ -154,6 +154,14 @@
      */
     public abstract void close() throws Exception;
 
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        return false;
+    }
+
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        throw new SQLException("InstanceKeyDataSource is not a wrapper.");
+    }
+
     // -------------------------------------------------------------------
     // Properties
 

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterCallableStatement.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterCallableStatement.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterCallableStatement.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterCallableStatement.java Wed Jan 14 05:04:24 2009
@@ -33,6 +33,11 @@
 import java.sql.Timestamp;
 import java.util.Calendar;
 import java.util.Map;
+/* JDBC_4_ANT_KEY_BEGIN */
+import java.sql.NClob;
+import java.sql.RowId;
+import java.sql.SQLXML;
+/* JDBC_4_ANT_KEY_END */
 
 /**
  * Trivial implementation of a CallableStatement to avoid null pointer exceptions in tests.
@@ -338,4 +343,114 @@
     public URL getURL(String parameterName) throws SQLException {
         return null;
     }
+/* JDBC_4_ANT_KEY_BEGIN */
+
+    public RowId getRowId(int parameterIndex) throws SQLException {
+        return null;
+    }
+
+    public RowId getRowId(String parameterName) throws SQLException {
+        return null;
+    }
+
+    public void setRowId(String parameterName, RowId value) throws SQLException {
+    }
+
+    public void setNString(String parameterName, String value) throws SQLException {
+    }
+
+    public void setNCharacterStream(String parameterName, Reader reader, long length) throws SQLException {
+    }
+
+    public void setNClob(String parameterName, NClob value) throws SQLException {
+    }
+
+    public void setClob(String parameterName, Reader reader, long length) throws SQLException {
+    }
+
+    public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException {
+    }
+
+    public void setNClob(String parameterName, Reader reader, long length) throws SQLException {
+    }
+
+    public NClob getNClob(int parameterIndex) throws SQLException {
+        return null;
+    }
+
+    public NClob getNClob(String parameterName) throws SQLException {
+        return null;
+    }
+
+    public void setSQLXML(String parameterName, SQLXML value) throws SQLException {
+    }
+
+    public SQLXML getSQLXML(int parameterIndex) throws SQLException {
+        return null;
+    }
+
+    public SQLXML getSQLXML(String parameterName) throws SQLException {
+        return null;
+    }
+
+    public String getNString(int parameterIndex) throws SQLException {
+        return null;
+    }
+
+    public String getNString(String parameterName) throws SQLException {
+        return null;
+    }
+
+    public Reader getNCharacterStream(int parameterIndex) throws SQLException {
+        return null;
+    }
+
+    public Reader getNCharacterStream(String parameterName) throws SQLException {
+        return null;
+    }
+
+    public Reader getCharacterStream(int parameterIndex) throws SQLException {
+        return null;
+    }
+
+    public Reader getCharacterStream(String parameterName) throws SQLException {
+        return null;
+    }
+
+    public void setBlob(String parameterName, Blob blob) throws SQLException {
+    }
+
+    public void setClob(String parameterName, Clob clob) throws SQLException {
+    }
+
+    public void setAsciiStream(String parameterName, InputStream inputStream, long length) throws SQLException {
+    }
+
+    public void setBinaryStream(String parameterName, InputStream inputStream, long length) throws SQLException {
+    }
+
+    public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException {
+    }
+
+    public void setAsciiStream(String parameterName, InputStream inputStream) throws SQLException {
+    }
+
+    public void setBinaryStream(String parameterName, InputStream inputStream) throws SQLException {
+    }
+
+    public void setCharacterStream(String parameterName, Reader reader) throws SQLException {
+    }
+
+    public void setNCharacterStream(String parameterName, Reader reader) throws SQLException {
+    }
+
+    public void setClob(String parameterName, Reader reader) throws SQLException {
+    }
+
+    public void setBlob(String parameterName, InputStream inputStream) throws SQLException {
+    }
+
+    public void setNClob(String parameterName, Reader reader) throws SQLException {
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterConnection.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterConnection.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterConnection.java Wed Jan 14 05:04:24 2009
@@ -25,6 +25,16 @@
 import java.sql.SQLWarning;
 import java.sql.Statement;
 import java.util.Map;
+/* JDBC_4_ANT_KEY_BEGIN */
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.NClob;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLXML;
+import java.sql.Struct;
+import java.util.Properties;
+/* JDBC_4_ANT_KEY_END */
 
 /**
  * A dummy {@link Connection}, for testing purposes.
@@ -274,6 +284,59 @@
         throws SQLException {
         return prepareStatement(sql);
     }
-
 /* JDBC_3_ANT_KEY_END */
+/* JDBC_4_ANT_KEY_BEGIN */
+
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public Blob createBlob() throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public Clob createClob() throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public NClob createNClob() throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public SQLXML createSQLXML() throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public boolean isValid(int timeout) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setClientInfo(String name, String value) throws SQLClientInfoException {
+        throw new SQLClientInfoException();
+    }
+
+    public void setClientInfo(Properties properties) throws SQLClientInfoException {
+        throw new SQLClientInfoException();
+    }
+
+    public Properties getClientInfo() throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public String getClientInfo(String name) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterPreparedStatement.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterPreparedStatement.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterPreparedStatement.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterPreparedStatement.java Wed Jan 14 05:04:24 2009
@@ -28,6 +28,13 @@
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.util.Calendar;
+/* JDBC_4_ANT_KEY_BEGIN */
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.NClob;
+import java.sql.RowId;
+import java.sql.SQLXML;
+/* JDBC_4_ANT_KEY_END */
 
 /**
  * A dummy {@link PreparedStatement}, for testing purposes.
@@ -288,7 +295,79 @@
     public java.sql.ParameterMetaData getParameterMetaData() throws SQLException {
         throw new SQLException("Not implemented.");
     }
-
 /* JDBC_3_ANT_KEY_END */
+/* JDBC_4_ANT_KEY_BEGIN */
+
+    public void setRowId(int parameterIndex, RowId value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setNString(int parameterIndex, String value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setNClob(int parameterIndex, NClob value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setSQLXML(int parameterIndex, SQLXML value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setAsciiStream(int parameterIndex, InputStream inputStream, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setBinaryStream(int parameterIndex, InputStream inputStream, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
 
+    public void setAsciiStream(int parameterIndex, InputStream inputStream) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setBinaryStream(int parameterIndex, InputStream inputStream) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setNCharacterStream(int parameterIndex, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setClob(int parameterIndex, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setNClob(int parameterIndex, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterResultSet.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterResultSet.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterResultSet.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterResultSet.java Wed Jan 14 05:04:24 2009
@@ -28,6 +28,13 @@
 import java.sql.SQLWarning;
 import java.sql.Statement;
 import java.util.Calendar;
+/* JDBC_4_ANT_KEY_BEGIN */
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.NClob;
+import java.sql.RowId;
+import java.sql.SQLXML;
+/* JDBC_4_ANT_KEY_END */
 
 /**
  * A dummy {@link ResultSet}, for testing purposes.
@@ -759,7 +766,207 @@
         throws SQLException {
         throw new SQLException("Not implemented.");
     }
-
 /* JDBC_3_ANT_KEY_END */
+/* JDBC_4_ANT_KEY_BEGIN */
+
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public RowId getRowId(int columnIndex) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public RowId getRowId(String columnLabel) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateRowId(int columnIndex, RowId value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateRowId(String columnLabel, RowId value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public int getHoldability() throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public boolean isClosed() throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNString(int columnIndex, String value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNString(String columnLabel, String value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNClob(int columnIndex, NClob value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNClob(String columnLabel, NClob value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public NClob getNClob(int columnIndex) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public NClob getNClob(String columnLabel) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public SQLXML getSQLXML(int columnIndex) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public SQLXML getSQLXML(String columnLabel) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateSQLXML(int columnIndex, SQLXML value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateSQLXML(String columnLabel, SQLXML value) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public String getNString(int columnIndex) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public String getNString(String columnLabel) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public Reader getNCharacterStream(int columnIndex) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public Reader getNCharacterStream(String columnLabel) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNCharacterStream(int columnIndex, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateAsciiStream(int columnIndex, InputStream inputStream, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateBinaryStream(int columnIndex, InputStream inputStream, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateCharacterStream(int columnIndex, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateAsciiStream(String columnLabel, InputStream inputStream, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateBinaryStream(String columnLabel, InputStream inputStream, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
 
+    public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNCharacterStream(int columnIndex, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateAsciiStream(int columnIndex, InputStream inputStream) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateBinaryStream(int columnIndex, InputStream inputStream) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateCharacterStream(int columnIndex, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateAsciiStream(String columnLabel, InputStream inputStream) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateBinaryStream(String columnLabel, InputStream inputStream) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateClob(int columnIndex, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateClob(String columnLabel, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNClob(int columnIndex, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void updateNClob(String columnLabel, Reader reader) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterStatement.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterStatement.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterStatement.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterStatement.java Wed Jan 14 05:04:24 2009
@@ -268,5 +268,26 @@
         throw new SQLException("Not implemented.");
     }
 /* JDBC_3_ANT_KEY_END */
+/* JDBC_4_ANT_KEY_BEGIN */
 
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public boolean isClosed() throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public void setPoolable(boolean poolable) throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+
+    public boolean isPoolable() throws SQLException {
+        throw new SQLException("Not implemented.");
+    }
+/* JDBC_4_ANT_KEY_END */
 }

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/PooledConnectionProxy.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/PooledConnectionProxy.java?rev=734378&r1=734377&r2=734378&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/PooledConnectionProxy.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/PooledConnectionProxy.java Wed Jan 14 05:04:24 2009
@@ -27,6 +27,7 @@
 import javax.sql.ConnectionEvent;
 import javax.sql.ConnectionEventListener;
 import javax.sql.PooledConnection;
+import javax.sql.StatementEventListener;
 
 /**
  * PooledConnection implementation that wraps a driver-supplied
@@ -136,4 +137,20 @@
         return eventListeners;
     }
 
+    /**
+     * Add a statement event listener
+     */
+    public void addStatementEventListener(StatementEventListener listener) {
+        if (!eventListeners.contains(listener)) {
+            eventListeners.add(listener);
+        }
+    }
+
+    /**
+     * Remove a statement event listener
+     */
+    public void removeStatementEventListener(StatementEventListener listener) {
+        eventListeners.remove(listener);
+    }
+
 }



Mime
View raw message