[jboss-cvs] JBossAS SVN: r109868 - in projects/jboss-jca/trunk: adapters and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 13 06:42:31 EST 2010
Author: jesper.pedersen
Date: 2010-12-13 06:42:30 -0500 (Mon, 13 Dec 2010)
New Revision: 109868
Added:
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/CachedCallableStatementJDK7.java
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/CachedPreparedStatementJDK7.java
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedCallableStatementJDK7.java
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionFactoryJDK7.java
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionJDK7.java
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedPreparedStatementJDK7.java
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedResultSetJDK7.java
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedStatementJDK7.java
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/package.html
Modified:
projects/jboss-jca/trunk/adapters/build.xml
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnection.java
projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrapperDataSource.java
projects/jboss-jca/trunk/build.xml
Log:
[JBJCA-475] Support JDBC 4.1 (Part 1)
Modified: projects/jboss-jca/trunk/adapters/build.xml
===================================================================
--- projects/jboss-jca/trunk/adapters/build.xml 2010-12-13 10:48:27 UTC (rev 109867)
+++ projects/jboss-jca/trunk/adapters/build.xml 2010-12-13 11:42:30 UTC (rev 109868)
@@ -31,7 +31,7 @@
<!-- =================================
Target: compile
================================= -->
- <target name="compile">
+ <target name="compile-base">
<mkdir dir="${build.adapters.dir}" />
<mkdir dir="${build.adapters.dir}/impl" />
@@ -40,11 +40,39 @@
classpathref="sjc.lib.path.id"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
- optimize="${javac.optimize}">
+ optimize="${javac.optimize}"
+ excludes="**/jdk6/**">
<compilerarg value="-Xlint"/>
</javac>
</target>
+ <target name="compile-jdk6" unless="HAVE_JDK_1.7">
+ <javac srcdir="src/main"
+ destdir="${build.adapters.dir}/impl"
+ classpathref="sjc.lib.path.id"
+ debug="${javac.debug}"
+ deprecation="${javac.deprecation}"
+ optimize="${javac.optimize}"
+ includes="**/jdk6/**">
+ <compilerarg value="-Xlint"/>
+ </javac>
+ </target>
+
+ <target name="compile-jdk7" if="HAVE_JDK_1.7">
+ <javac srcdir="src/main"
+ destdir="${build.adapters.dir}/impl"
+ classpathref="sjc.lib.path.id"
+ debug="${javac.debug}"
+ deprecation="${javac.deprecation}"
+ optimize="${javac.optimize}"
+ includes="**/jdk7/**">
+ <compilerarg value="-Xlint"/>
+ </javac>
+ </target>
+
+ <target name="compile" depends="compile-base,compile-jdk6">
+ </target>
+
<!-- =================================
Target: jars
================================= -->
Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnection.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnection.java 2010-12-13 10:48:27 UTC (rev 109867)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnection.java 2010-12-13 11:42:30 UTC (rev 109868)
@@ -66,6 +66,9 @@
/** JDBC 4 factory */
private static final String JDBC4_FACTORY = "org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionFactoryJDK6";
+ /** JDBC 4.1 factory */
+ private static final String JDBC41_FACTORY = "org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionFactoryJDK7";
+
/** The managed connection factory */
protected final BaseWrapperManagedConnectionFactory mcf;
@@ -123,7 +126,14 @@
}
catch (ClassNotFoundException e)
{
- throw new RuntimeException("Unabled to load wrapped connection factory", e);
+ try
+ {
+ connectionFactory = BaseWrapperManagedConnection.class.forName(JDBC41_FACTORY);
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ throw new RuntimeException("Unabled to load wrapped connection factory", cnfe);
+ }
}
try
Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrapperDataSource.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrapperDataSource.java 2010-12-13 10:48:27 UTC (rev 109867)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrapperDataSource.java 2010-12-13 11:42:30 UTC (rev 109868)
@@ -28,6 +28,7 @@
import java.io.Serializable;
import java.sql.Connection;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import javax.naming.Reference;
import javax.resource.Referenceable;
@@ -101,6 +102,14 @@
/**
* {@inheritDoc}
*/
+ public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException
+ {
+ throw new SQLFeatureNotSupportedException();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public Connection getConnection() throws SQLException
{
try
Added: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/CachedCallableStatementJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/CachedCallableStatementJDK7.java (rev 0)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/CachedCallableStatementJDK7.java 2010-12-13 11:42:30 UTC (rev 109868)
@@ -0,0 +1,512 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.adapters.jdbc.jdk7;
+
+import org.jboss.jca.adapters.jdbc.CachedCallableStatement;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
+import java.sql.NClob;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+
+/**
+ * CachedCallableStatementJDK7.
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+ at SuppressWarnings("deprecation")
+public class CachedCallableStatementJDK7 extends CachedCallableStatement
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor
+ * @param cs The callable statement
+ * @exception SQLException Thrown if an error occurs
+ */
+ public CachedCallableStatementJDK7(CallableStatement cs) throws SQLException
+ {
+ super(cs);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
+ {
+ getWrappedObject().setAsciiStream(parameterIndex, x, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
+ {
+ getWrappedObject().setAsciiStream(parameterIndex, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
+ {
+ getWrappedObject().setBinaryStream(parameterIndex, x, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
+ {
+ getWrappedObject().setBinaryStream(parameterIndex, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
+ {
+ getWrappedObject().setBlob(parameterIndex, inputStream, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
+ {
+ getWrappedObject().setBlob(parameterIndex, inputStream);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ getWrappedObject().setCharacterStream(parameterIndex, reader, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
+ {
+ getWrappedObject().setCharacterStream(parameterIndex, reader);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ getWrappedObject().setClob(parameterIndex, reader, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(int parameterIndex, Reader reader) throws SQLException
+ {
+ getWrappedObject().setClob(parameterIndex, reader);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
+ {
+ getWrappedObject().setNCharacterStream(parameterIndex, value, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
+ {
+ getWrappedObject().setNCharacterStream(parameterIndex, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, NClob value) throws SQLException
+ {
+ getWrappedObject().setNClob(parameterIndex, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ getWrappedObject().setNClob(parameterIndex, reader, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, Reader reader) throws SQLException
+ {
+ getWrappedObject().setNClob(parameterIndex, reader);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNString(int parameterIndex, String value) throws SQLException
+ {
+ getWrappedObject().setNString(parameterIndex, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setRowId(int parameterIndex, RowId x) throws SQLException
+ {
+ getWrappedObject().setRowId(parameterIndex, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
+ {
+ getWrappedObject().setSQLXML(parameterIndex, xmlObject);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isClosed() throws SQLException
+ {
+ return getWrappedObject().isClosed();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isPoolable() throws SQLException
+ {
+ return getWrappedObject().isPoolable();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPoolable(boolean poolable) throws SQLException
+ {
+ getWrappedObject().setPoolable(poolable);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Reader getCharacterStream(int parameterIndex) throws SQLException
+ {
+ return getWrappedObject().getCharacterStream(parameterIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Reader getCharacterStream(String parameterName) throws SQLException
+ {
+ return getWrappedObject().getCharacterStream(parameterName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Reader getNCharacterStream(int parameterIndex) throws SQLException
+ {
+ return getWrappedObject().getNCharacterStream(parameterIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Reader getNCharacterStream(String parameterName) throws SQLException
+ {
+ return getWrappedObject().getNCharacterStream(parameterName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NClob getNClob(int parameterIndex) throws SQLException
+ {
+ return getWrappedObject().getNClob(parameterIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NClob getNClob(String parameterName) throws SQLException
+ {
+ return getWrappedObject().getNClob(parameterName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getNString(int parameterIndex) throws SQLException
+ {
+ return getWrappedObject().getNString(parameterIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getNString(String parameterName) throws SQLException
+ {
+ return getWrappedObject().getNString(parameterName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public RowId getRowId(int parameterIndex) throws SQLException
+ {
+ return getWrappedObject().getRowId(parameterIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public RowId getRowId(String parameterName) throws SQLException
+ {
+ return getWrappedObject().getRowId(parameterName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public SQLXML getSQLXML(int parameterIndex) throws SQLException
+ {
+ return getWrappedObject().getSQLXML(parameterIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public SQLXML getSQLXML(String parameterName) throws SQLException
+ {
+ return getWrappedObject().getSQLXML(parameterName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException
+ {
+ getWrappedObject().setAsciiStream(parameterName, x, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(String parameterName, InputStream x) throws SQLException
+ {
+ getWrappedObject().setAsciiStream(parameterName, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(String parameterName, InputStream x, long length) throws SQLException
+ {
+ getWrappedObject().setBinaryStream(parameterName, x, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(String parameterName, InputStream x) throws SQLException
+ {
+ getWrappedObject().setBinaryStream(parameterName, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(String parameterName, Blob x) throws SQLException
+ {
+ getWrappedObject().setBlob(parameterName, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException
+ {
+ getWrappedObject().setBlob(parameterName, inputStream, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(String parameterName, InputStream inputStream) throws SQLException
+ {
+ getWrappedObject().setBlob(parameterName, inputStream);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException
+ {
+ getWrappedObject().setCharacterStream(parameterName, reader, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(String parameterName, Reader reader) throws SQLException
+ {
+ getWrappedObject().setCharacterStream(parameterName, reader);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(String parameterName, Clob x) throws SQLException
+ {
+ getWrappedObject().setClob(parameterName, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(String parameterName, Reader reader, long length) throws SQLException
+ {
+ getWrappedObject().setClob(parameterName, reader, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(String parameterName, Reader reader) throws SQLException
+ {
+ getWrappedObject().setClob(parameterName, reader);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException
+ {
+ getWrappedObject().setNCharacterStream(parameterName, value, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(String parameterName, Reader value) throws SQLException
+ {
+ getWrappedObject().setNCharacterStream(parameterName, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(String parameterName, NClob value) throws SQLException
+ {
+ getWrappedObject().setNClob(parameterName, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(String parameterName, Reader reader, long length) throws SQLException
+ {
+ getWrappedObject().setNClob(parameterName, reader, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(String parameterName, Reader reader) throws SQLException
+ {
+ getWrappedObject().setNClob(parameterName, reader);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNString(String parameterName, String value) throws SQLException
+ {
+ getWrappedObject().setNString(parameterName, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setRowId(String parameterName, RowId x) throws SQLException
+ {
+ getWrappedObject().setRowId(parameterName, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
+ {
+ getWrappedObject().setSQLXML(parameterName, xmlObject);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void closeOnCompletion() throws SQLException
+ {
+ getWrappedObject().closeOnCompletion();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isCloseOnCompletion() throws SQLException
+ {
+ return getWrappedObject().isCloseOnCompletion();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException
+ {
+ return getWrappedObject().getObject(parameterIndex, type);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public <T> T getObject(String parameterName, Class<T> type) throws SQLException
+ {
+ return getWrappedObject().getObject(parameterName, type);
+ }
+}
Added: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/CachedPreparedStatementJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/CachedPreparedStatementJDK7.java (rev 0)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/CachedPreparedStatementJDK7.java 2010-12-13 11:42:30 UTC (rev 109868)
@@ -0,0 +1,237 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.adapters.jdbc.jdk7;
+
+import org.jboss.jca.adapters.jdbc.CachedPreparedStatement;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+
+/**
+ * CachedPreparedStatementJDK7.
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class CachedPreparedStatementJDK7 extends CachedPreparedStatement
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor
+ * @param ps The prepared statement
+ * @exception SQLException Thrown if an error occurs
+ */
+ public CachedPreparedStatementJDK7(PreparedStatement ps) throws SQLException
+ {
+ super(ps);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
+ {
+ getWrappedObject().setAsciiStream(parameterIndex, x, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
+ {
+ getWrappedObject().setAsciiStream(parameterIndex, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
+ {
+ getWrappedObject().setBinaryStream(parameterIndex, x, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
+ {
+ getWrappedObject().setBinaryStream(parameterIndex, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
+ {
+ getWrappedObject().setBlob(parameterIndex, inputStream, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
+ {
+ getWrappedObject().setBlob(parameterIndex, inputStream);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ getWrappedObject().setCharacterStream(parameterIndex, reader, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
+ {
+ getWrappedObject().setCharacterStream(parameterIndex, reader);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ getWrappedObject().setClob(parameterIndex, reader, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(int parameterIndex, Reader reader) throws SQLException
+ {
+ getWrappedObject().setClob(parameterIndex, reader);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
+ {
+ getWrappedObject().setNCharacterStream(parameterIndex, value, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
+ {
+ getWrappedObject().setNCharacterStream(parameterIndex, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, NClob value) throws SQLException
+ {
+ getWrappedObject().setNClob(parameterIndex, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ getWrappedObject().setNClob(parameterIndex, reader, length);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, Reader reader) throws SQLException
+ {
+ getWrappedObject().setNClob(parameterIndex, reader);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNString(int parameterIndex, String value) throws SQLException
+ {
+ getWrappedObject().setNString(parameterIndex, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setRowId(int parameterIndex, RowId x) throws SQLException
+ {
+ getWrappedObject().setRowId(parameterIndex, x);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
+ {
+ getWrappedObject().setSQLXML(parameterIndex, xmlObject);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isClosed() throws SQLException
+ {
+ return getWrappedObject().isClosed();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isPoolable() throws SQLException
+ {
+ return getWrappedObject().isPoolable();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPoolable(boolean poolable) throws SQLException
+ {
+ getWrappedObject().setPoolable(poolable);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void closeOnCompletion() throws SQLException
+ {
+ getWrappedObject().closeOnCompletion();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isCloseOnCompletion() throws SQLException
+ {
+ return getWrappedObject().isCloseOnCompletion();
+ }
+}
Added: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedCallableStatementJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedCallableStatementJDK7.java (rev 0)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedCallableStatementJDK7.java 2010-12-13 11:42:30 UTC (rev 109868)
@@ -0,0 +1,982 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.adapters.jdbc.jdk7;
+
+import org.jboss.jca.adapters.jdbc.WrappedCallableStatement;
+import org.jboss.jca.adapters.jdbc.WrappedResultSet;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+
+/**
+ * WrappedCallableStatementJDK7.
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class WrappedCallableStatementJDK7 extends WrappedCallableStatement
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor
+ * @param lc The connection
+ * @param s The statement
+ */
+ public WrappedCallableStatementJDK7(WrappedConnectionJDK7 lc, CallableStatement s)
+ {
+ super(lc, s);
+ }
+
+ /**
+ * Wrap result set
+ * @param resultSet The result set
+ * @return The result
+ */
+ protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+ {
+ return new WrappedResultSetJDK7(this, resultSet);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isClosed() throws SQLException
+ {
+ try
+ {
+ PreparedStatement wrapped = getWrappedObject();
+ if (wrapped == null)
+ return true;
+ return wrapped.isClosed();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isPoolable() throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.isPoolable();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPoolable(boolean poolable) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setPoolable(poolable);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setAsciiStream(parameterIndex, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setAsciiStream(parameterIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBinaryStream(parameterIndex, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBinaryStream(parameterIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBlob(parameterIndex, inputStream, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBlob(parameterIndex, inputStream);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setCharacterStream(parameterIndex, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setCharacterStream(parameterIndex, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setClob(parameterIndex, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(int parameterIndex, Reader reader) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setClob(parameterIndex, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNCharacterStream(parameterIndex, value, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNCharacterStream(parameterIndex, value);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, NClob value) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNClob(parameterIndex, value);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNClob(parameterIndex, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, Reader reader) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNClob(parameterIndex, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNString(int parameterIndex, String value) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNString(parameterIndex, value);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setRowId(int parameterIndex, RowId x) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setRowId(parameterIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setSQLXML(parameterIndex, xmlObject);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Reader getCharacterStream(int parameterIndex) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getCharacterStream(parameterIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Reader getCharacterStream(String parameterName) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getCharacterStream(parameterName);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Reader getNCharacterStream(int parameterIndex) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getNCharacterStream(parameterIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Reader getNCharacterStream(String parameterName) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getCharacterStream(parameterName);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NClob getNClob(int parameterIndex) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getNClob(parameterIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NClob getNClob(String parameterName) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getNClob(parameterName);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getNString(int parameterIndex) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getNString(parameterIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getNString(String parameterName) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getNString(parameterName);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public RowId getRowId(int parameterIndex) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getRowId(parameterIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public RowId getRowId(String parameterName) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getRowId(parameterName);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public SQLXML getSQLXML(int parameterIndex) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getSQLXML(parameterIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public SQLXML getSQLXML(String parameterName) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getSQLXML(parameterName);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setAsciiStream(parameterName, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(String parameterName, InputStream x) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setAsciiStream(parameterName, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(String parameterName, InputStream x, long length) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBinaryStream(parameterName, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(String parameterName, InputStream x) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBinaryStream(parameterName, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(String parameterName, Blob x) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBlob(parameterName, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBlob(parameterName, inputStream, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(String parameterName, InputStream inputStream) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBlob(parameterName, inputStream);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setCharacterStream(parameterName, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(String parameterName, Reader reader) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setCharacterStream(parameterName, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(String parameterName, Clob x) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setClob(parameterName, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(String parameterName, Reader reader, long length) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setClob(parameterName, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(String parameterName, Reader reader) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setClob(parameterName, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNCharacterStream(parameterName, value, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(String parameterName, Reader value) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNCharacterStream(parameterName, value);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(String parameterName, NClob value) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNClob(parameterName, value);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(String parameterName, Reader reader, long length) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNClob(parameterName, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(String parameterName, Reader reader) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNClob(parameterName, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNString(String parameterName, String value) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNString(parameterName, value);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setRowId(String parameterName, RowId x) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setRowId(parameterName, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setSQLXML(parameterName, xmlObject);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void closeOnCompletion() throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.closeOnCompletion();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isCloseOnCompletion() throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.isCloseOnCompletion();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getObject(parameterIndex, type);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public <T> T getObject(String parameterName, Class<T> type) throws SQLException
+ {
+ CallableStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.getObject(parameterName, type);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+}
Added: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionFactoryJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionFactoryJDK7.java (rev 0)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionFactoryJDK7.java 2010-12-13 11:42:30 UTC (rev 109868)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.adapters.jdbc.jdk7;
+
+import org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection;
+import org.jboss.jca.adapters.jdbc.CachedCallableStatement;
+import org.jboss.jca.adapters.jdbc.CachedPreparedStatement;
+import org.jboss.jca.adapters.jdbc.WrappedConnection;
+import org.jboss.jca.adapters.jdbc.WrappedConnectionFactory;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+/**
+ * WrappedConnectionFactoryJDK7
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class WrappedConnectionFactoryJDK7 implements WrappedConnectionFactory
+{
+ /**
+ * Constructor
+ */
+ public WrappedConnectionFactoryJDK7()
+ {
+ }
+
+ /**
+ * Wrap connection
+ * @param mc The managed connection
+ * @return The result
+ */
+ public WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc)
+ {
+ return new WrappedConnectionJDK7(mc);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public CachedPreparedStatement createCachedPreparedStatement(PreparedStatement ps) throws SQLException
+ {
+ return new CachedPreparedStatementJDK7(ps);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public CachedCallableStatement createCachedCallableStatement(CallableStatement cs) throws SQLException
+ {
+ return new CachedCallableStatementJDK7(cs);
+ }
+}
Added: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionJDK7.java (rev 0)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionJDK7.java 2010-12-13 11:42:30 UTC (rev 109868)
@@ -0,0 +1,517 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.adapters.jdbc.jdk7;
+
+import org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection;
+import org.jboss.jca.adapters.jdbc.WrappedCallableStatement;
+import org.jboss.jca.adapters.jdbc.WrappedConnection;
+import org.jboss.jca.adapters.jdbc.WrappedPreparedStatement;
+import org.jboss.jca.adapters.jdbc.WrappedStatement;
+
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
+import java.sql.Connection;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+import java.sql.Statement;
+import java.sql.Struct;
+import java.util.Properties;
+import java.util.concurrent.Executor;
+
+/**
+ * WrappedConnectionJDK7.
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+ at SuppressWarnings("unchecked")
+public class WrappedConnectionJDK7 extends WrappedConnection
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Create a new WrappedConnectionJDK7.
+ *
+ * @param mc the managed connection
+ */
+ public WrappedConnectionJDK7(BaseWrapperManagedConnection mc)
+ {
+ super(mc);
+ }
+
+ /**
+ * Wrap statement
+ * @param statement The statement
+ * @return The result
+ */
+ protected WrappedStatement wrapStatement(Statement statement)
+ {
+ return new WrappedStatementJDK7(this, statement);
+ }
+
+ /**
+ * Wrap prepared statement
+ * @param statement The statement
+ * @return The result
+ */
+ protected WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement)
+ {
+ return new WrappedPreparedStatementJDK7(this, statement);
+ }
+
+ /**
+ * Wrap callable statement
+ * @param statement The statement
+ * @return The result
+ */
+ protected WrappedCallableStatement wrapCallableStatement(CallableStatement statement)
+ {
+ return new WrappedCallableStatementJDK7(this, statement);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Array createArrayOf(String typeName, Object[] elements) throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.createArrayOf(typeName, elements);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Blob createBlob() throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.createBlob();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Clob createClob() throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.createClob();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NClob createNClob() throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.createNClob();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public SQLXML createSQLXML() throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.createSQLXML();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Struct createStruct(String typeName, Object[] attributes) throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.createStruct(typeName, attributes);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Properties getClientInfo() throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.getClientInfo();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getClientInfo(String name) throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.getClientInfo(name);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isValid(int timeout) throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.isValid(timeout);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClientInfo(Properties properties) throws SQLClientInfoException
+ {
+ try
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ c.setClientInfo(properties);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ catch (SQLClientInfoException e)
+ {
+ throw e;
+ }
+ catch (SQLException e)
+ {
+ SQLClientInfoException t = new SQLClientInfoException();
+ t.initCause(e);
+ throw t;
+ }
+ }
+ catch (SQLException e)
+ {
+ SQLClientInfoException t = new SQLClientInfoException();
+ t.initCause(e);
+ throw t;
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClientInfo(String name, String value) throws SQLClientInfoException
+ {
+ try
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ c.setClientInfo(name, value);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ catch (SQLClientInfoException e)
+ {
+ throw e;
+ }
+ catch (SQLException e)
+ {
+ SQLClientInfoException t = new SQLClientInfoException();
+ t.initCause(e);
+ throw t;
+ }
+ }
+ catch (SQLException e)
+ {
+ SQLClientInfoException t = new SQLClientInfoException();
+ t.initCause(e);
+ throw t;
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setSchema(String schema) throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ c.setSchema(schema);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getSchema() throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.getSchema();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void abort(Executor executor) throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ c.abort(executor);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ c.setNetworkTimeout(executor, milliseconds);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getNetworkTimeout() throws SQLException
+ {
+ lock();
+ try
+ {
+ Connection c = getUnderlyingConnection();
+ try
+ {
+ return c.getNetworkTimeout();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+}
Added: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedPreparedStatementJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedPreparedStatementJDK7.java (rev 0)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedPreparedStatementJDK7.java 2010-12-13 11:42:30 UTC (rev 109868)
@@ -0,0 +1,616 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.adapters.jdbc.jdk7;
+
+import org.jboss.jca.adapters.jdbc.WrappedPreparedStatement;
+import org.jboss.jca.adapters.jdbc.WrappedResultSet;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+
+/**
+ * WrappedPreparedStatementJDK7.
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class WrappedPreparedStatementJDK7 extends WrappedPreparedStatement
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor
+ * @param lc The connection
+ * @param s The prepared statement
+ */
+ public WrappedPreparedStatementJDK7(WrappedConnectionJDK7 lc, PreparedStatement s)
+ {
+ super(lc, s);
+ }
+
+ /**
+ * Wrap the result set
+ * @param resultSet The result set
+ * @return The result
+ */
+ protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+ {
+ return new WrappedResultSetJDK7(this, resultSet);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isClosed() throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement wrapped = getWrappedObject();
+ if (wrapped == null)
+ return true;
+ return wrapped.isClosed();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isPoolable() throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.isPoolable();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPoolable(boolean poolable) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setPoolable(poolable);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setAsciiStream(parameterIndex, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setAsciiStream(parameterIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBinaryStream(parameterIndex, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBinaryStream(parameterIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBlob(parameterIndex, inputStream, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setBlob(parameterIndex, inputStream);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setCharacterStream(parameterIndex, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setCharacterStream(parameterIndex, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setClob(parameterIndex, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setClob(int parameterIndex, Reader reader) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setClob(parameterIndex, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNCharacterStream(parameterIndex, value, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNCharacterStream(parameterIndex, value);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, NClob value) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNClob(parameterIndex, value);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNClob(parameterIndex, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNClob(int parameterIndex, Reader reader) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNClob(parameterIndex, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNString(int parameterIndex, String value) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setNString(parameterIndex, value);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setRowId(int parameterIndex, RowId x) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setRowId(parameterIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setSQLXML(parameterIndex, xmlObject);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void closeOnCompletion() throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ statement.closeOnCompletion();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isCloseOnCompletion() throws SQLException
+ {
+ lock();
+ try
+ {
+ PreparedStatement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.isCloseOnCompletion();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+}
Added: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedResultSetJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedResultSetJDK7.java (rev 0)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedResultSetJDK7.java 2010-12-13 11:42:30 UTC (rev 109868)
@@ -0,0 +1,856 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.adapters.jdbc.jdk7;
+
+import org.jboss.jca.adapters.jdbc.WrappedResultSet;
+import org.jboss.jca.adapters.jdbc.WrappedStatement;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.NClob;
+import java.sql.ResultSet;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+
+/**
+ * WrappedResultSetJDK7.
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class WrappedResultSetJDK7 extends WrappedResultSet
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor
+ * @param statement The statement
+ * @param resultSet The result set
+ */
+ public WrappedResultSetJDK7(WrappedStatement statement, ResultSet resultSet)
+ {
+ super(statement, resultSet);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getHoldability() throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getHoldability();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Reader getNCharacterStream(int columnIndex) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getNCharacterStream(columnIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Reader getNCharacterStream(String columnLabel) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getNCharacterStream(columnLabel);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NClob getNClob(int columnIndex) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getNClob(columnIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NClob getNClob(String columnLabel) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getNClob(columnLabel);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getNString(int columnIndex) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getNString(columnIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getNString(String columnLabel) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getNString(columnLabel);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public RowId getRowId(int columnIndex) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getRowId(columnIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public RowId getRowId(String columnLabel) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getRowId(columnLabel);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public SQLXML getSQLXML(int columnIndex) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getSQLXML(columnIndex);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public SQLXML getSQLXML(String columnLabel) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getSQLXML(columnLabel);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isClosed() throws SQLException
+ {
+ ResultSet resultSet = getWrappedObject();
+ if (resultSet == null)
+ return true;
+ try
+ {
+ return resultSet.isClosed();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateAsciiStream(columnIndex, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateAsciiStream(columnIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateAsciiStream(columnLabel, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateAsciiStream(columnLabel, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateBinaryStream(columnIndex, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateBinaryStream(columnIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateBinaryStream(columnLabel, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateBinaryStream(columnLabel, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateBlob(columnIndex, inputStream, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateBlob(columnIndex, inputStream);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateBlob(columnLabel, inputStream, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateBlob(columnLabel, inputStream);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateCharacterStream(columnIndex, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateCharacterStream(int columnIndex, Reader x) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateCharacterStream(columnIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateCharacterStream(columnLabel, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateCharacterStream(columnLabel, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateClob(int columnIndex, Reader reader, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateClob(columnIndex, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateClob(int columnIndex, Reader reader) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateClob(columnIndex, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateClob(String columnLabel, Reader reader, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateClob(columnLabel, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateClob(String columnLabel, Reader reader) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateClob(columnLabel, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNCharacterStream(columnIndex, x, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNCharacterStream(columnIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNCharacterStream(columnLabel, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNCharacterStream(columnLabel, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNClob(int columnIndex, NClob clob) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNClob(columnIndex, clob);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNClob(columnIndex, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNClob(int columnIndex, Reader reader) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNClob(columnIndex, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNClob(String columnLabel, NClob clob) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNClob(columnLabel, clob);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNClob(columnLabel, reader, length);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNClob(String columnLabel, Reader reader) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNClob(columnLabel, reader);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNString(int columnIndex, String string) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNString(columnIndex, string);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateNString(String columnLabel, String string) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateNString(columnLabel, string);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateRowId(int columnIndex, RowId x) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateRowId(columnIndex, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateRowId(String columnLabel, RowId x) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateRowId(columnLabel, x);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateSQLXML(columnIndex, xmlObject);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ resultSet.updateSQLXML(columnLabel, xmlObject);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getObject(parameterIndex, type);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public <T> T getObject(String parameterName, Class<T> type) throws SQLException
+ {
+ ResultSet resultSet = getUnderlyingResultSet();
+ try
+ {
+ return resultSet.getObject(parameterName, type);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+}
Added: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedStatementJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedStatementJDK7.java (rev 0)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedStatementJDK7.java 2010-12-13 11:42:30 UTC (rev 109868)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.adapters.jdbc.jdk7;
+
+import org.jboss.jca.adapters.jdbc.WrappedResultSet;
+import org.jboss.jca.adapters.jdbc.WrappedStatement;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+/**
+ * WrappedStatementJDK7.
+ *
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class WrappedStatementJDK7 extends WrappedStatement
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor
+ * @param lc The connection
+ * @param s The statement
+ */
+ public WrappedStatementJDK7(WrappedConnectionJDK7 lc, Statement s)
+ {
+ super(lc, s);
+ }
+
+ /**
+ * Wrap ResultSet
+ * @param resultSet The ResultSet
+ * @return The result
+ */
+ protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+ {
+ return new WrappedResultSetJDK7(this, resultSet);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isClosed() throws SQLException
+ {
+ lock();
+ try
+ {
+ Statement wrapped = getWrappedObject();
+ if (wrapped == null)
+ return true;
+ return wrapped.isClosed();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isPoolable() throws SQLException
+ {
+ lock();
+ try
+ {
+ Statement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.isPoolable();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPoolable(boolean poolable) throws SQLException
+ {
+ lock();
+ try
+ {
+ Statement statement = getUnderlyingStatement();
+ try
+ {
+ statement.setPoolable(poolable);
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void closeOnCompletion() throws SQLException
+ {
+ lock();
+ try
+ {
+ Statement statement = getUnderlyingStatement();
+ try
+ {
+ statement.closeOnCompletion();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isCloseOnCompletion() throws SQLException
+ {
+ lock();
+ try
+ {
+ Statement statement = getUnderlyingStatement();
+ try
+ {
+ return statement.isCloseOnCompletion();
+ }
+ catch (Throwable t)
+ {
+ throw checkException(t);
+ }
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+}
Added: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/package.html
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/package.html (rev 0)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/package.html 2010-12-13 11:42:30 UTC (rev 109868)
@@ -0,0 +1,3 @@
+<body>
+This package contains the JDBC 4.1 extension
+</body>
Modified: projects/jboss-jca/trunk/build.xml
===================================================================
--- projects/jboss-jca/trunk/build.xml 2010-12-13 10:48:27 UTC (rev 109867)
+++ projects/jboss-jca/trunk/build.xml 2010-12-13 11:42:30 UTC (rev 109868)
@@ -26,6 +26,7 @@
<available classname="java.lang.Enum" property="HAVE_JDK_1.5"/>
<available classname="java.lang.management.LockInfo" property="HAVE_JDK_1.6"/>
+ <available classname="java.util.concurrent.ForkJoinPool" property="HAVE_JDK_1.7"/>
<!-- =================================
Project
More information about the jboss-cvs-commits
mailing list