db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1071558 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java
Date Thu, 17 Feb 2011 09:33:29 GMT
Author: kahatlen
Date: Thu Feb 17 09:33:29 2011
New Revision: 1071558

URL: http://svn.apache.org/viewvc?rev=1071558&view=rev
Log:
DERBY-5050: BrokeredConnection could call setHoldability() without using reflection

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java?rev=1071558&r1=1071557&r2=1071558&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java Thu
Feb 17 09:33:29 2011
@@ -32,14 +32,7 @@ import java.sql.SQLWarning;
 
 import org.apache.derby.impl.jdbc.Util;
 
-import java.io.ObjectOutput;
-import java.io.ObjectInput;
-
-import java.lang.reflect.*;
-
-import org.apache.derby.iapi.error.PublicAPI;
 import org.apache.derby.iapi.error.SQLWarningFactory;
-import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.shared.common.reference.SQLState;
 
 /**
@@ -433,17 +426,7 @@ public abstract class BrokeredConnection
 			// make the underlying connection pick my holdability state
 			// since holdability is a state of the connection handle
 			// not the underlying transaction.
-			// jdk13 does not have Connection.setHoldability method and hence using
-			// reflection to cover both jdk13 and higher jdks
-			try {
-		        Class[] CONN_PARAM = { Integer.TYPE };
-		        Object[] CONN_ARG = { new Integer(stateHoldability)};
-				Method sh = conn.getClass().getMethod("setHoldability", CONN_PARAM);
-				sh.invoke(conn, CONN_ARG);
-			} catch( Exception e)
-			{
-				throw PublicAPI.wrapStandardException( StandardException.plainWrapException( e));
-			}
+            conn.setHoldability(stateHoldability);
 		}
 	}
 



Mime
View raw message