[jboss-svn-commits] JBL Code SVN: r38017 - in labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTA/jdbc/classes/com/arjuna/ats: jdbc and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Apr 13 13:33:49 EDT 2012
Author: tomjenkinson
Date: 2012-04-13 13:33:48 -0400 (Fri, 13 Apr 2012)
New Revision: 38017
Modified:
labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/ConnectionImple.java
labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/TransactionalDriver.java
Log:
JBTM-1120 added JDBC 4.0 support
Modified: labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/ConnectionImple.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/ConnectionImple.java 2012-04-13 16:57:36 UTC (rev 38016)
+++ labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/ConnectionImple.java 2012-04-13 17:33:48 UTC (rev 38017)
@@ -51,6 +51,7 @@
import javax.transaction.xa.*;
import javax.sql.*;
import java.util.*;
+import java.util.concurrent.Executor;
import java.sql.*;
import javax.transaction.RollbackException;
import java.sql.SQLException;
@@ -571,6 +572,191 @@
* *******************************************************************
*/
+ /*
+ * ******************************************************************* *
+ * JDBC 4.0 method section.
+ */
+
+ public Clob createClob() throws SQLException
+ {
+ checkTransaction();
+
+ registerDatabase();
+
+ return getConnection().createClob();
+ }
+
+ public Blob createBlob() throws SQLException
+ {
+ checkTransaction();
+
+ registerDatabase();
+
+ return getConnection().createBlob();
+ }
+
+ public NClob createNClob() throws SQLException
+ {
+ checkTransaction();
+
+ registerDatabase();
+
+ return getConnection().createNClob();
+ }
+
+ public SQLXML createSQLXML() throws SQLException
+ {
+ checkTransaction();
+
+ registerDatabase();
+
+ return getConnection().createSQLXML();
+ }
+
+ public boolean isValid(int timeout) throws SQLException
+ {
+ checkTransaction();
+
+ registerDatabase();
+
+ return getConnection().isValid(timeout);
+ }
+
+ public String getClientInfo(String name) throws SQLException
+ {
+ return getConnection().getClientInfo(name);
+ }
+
+ public Properties getClientInfo() throws SQLException
+ {
+ return getConnection().getClientInfo();
+ }
+
+ public void setClientInfo(String name, String value) throws SQLClientInfoException
+ {
+ try
+ {
+ getConnection().setClientInfo(name, value);
+ }
+ catch(SQLException e)
+ {
+ throw new SQLClientInfoException("setClientInfo : getConnection failed", null, e);
+ }
+ }
+
+ public void setClientInfo(Properties properties) throws SQLClientInfoException
+ {
+ try
+ {
+ getConnection().setClientInfo(properties);
+ }
+ catch(SQLException e)
+ {
+ throw new SQLClientInfoException("setClientInfo : getConnection failed", null, e);
+ }
+ }
+
+ public Array createArrayOf(String typeName, Object[] elements) throws SQLException
+ {
+ checkTransaction();
+
+ registerDatabase();
+
+ return getConnection().createArrayOf(typeName, elements);
+ }
+
+ public Struct createStruct(String typeName, Object[] attributes) throws SQLException
+ {
+ checkTransaction();
+
+ registerDatabase();
+
+ return getConnection().createStruct(typeName, attributes);
+ }
+
+ public <T> T unwrap(Class<T> iface) throws SQLException
+ {
+ if (iface != null) {
+ if (iface.isInstance(this)) {
+ return (T) this;
+ } else {
+ Connection conn = getConnection();
+ if (conn != null) {
+ if (iface.isInstance(conn)) {
+ return (T) conn;
+ } else if(conn.isWrapperFor(iface)) {
+ return conn.unwrap(iface);
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public boolean isWrapperFor(Class<?> iface) throws SQLException
+ {
+ if (iface != null) {
+ if (iface.isInstance(this)) {
+ return true;
+ } else {
+ Connection conn = getConnection();
+ if (conn != null) {
+ if (iface.isInstance(conn)) {
+ return true;
+ } else {
+ return conn.isWrapperFor(iface);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /*
+ * end of the JDBC 4.0 section
+ * *******************************************************************
+ */
+
+ /*
+ * ******************************************************************* *
+ * Java 7 method section.
+ */
+
+ //@Override
+ public void setSchema(String schema) throws SQLException
+ {
+ throw new SQLException();
+ }
+
+ //@Override
+ public String getSchema() throws SQLException
+ {
+ throw new SQLException();
+ }
+
+ //@Override
+ public void abort(Executor executor) throws SQLException
+ {
+ throw new SQLException();
+ }
+
+ //@Override
+ public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
+ {
+ throw new SQLException();
+ }
+
+ //@Override
+ public int getNetworkTimeout() throws SQLException
+ {
+ throw new SQLException();
+ }
+
+ /*
+ * end of the Java 7 section
+ * *******************************************************************
+ */
+
/**
* @return the XAResource associated with the current XAConnection.
*/
Modified: labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/TransactionalDriver.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/TransactionalDriver.java 2012-04-13 16:57:36 UTC (rev 38016)
+++ labs/jbosstm/branches/JBOSSTS_4_6_1_GA_CP/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/TransactionalDriver.java 2012-04-13 17:33:48 UTC (rev 38017)
@@ -40,9 +40,11 @@
import com.arjuna.common.util.logging.*;
import java.util.*;
+import java.util.logging.Logger;
import java.sql.*;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import java.lang.ExceptionInInitializerError;
/**
@@ -152,6 +154,12 @@
}
}
+ // JBTM-1120 JDK7 NO-OPS
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException
+ {
+ throw new SQLFeatureNotSupportedException ();
+ }
+
static
{
try
More information about the jboss-svn-commits
mailing list