List:Internals« Previous MessageNext Message »
From:mmatthews Date:August 23 2005 5:24am
Subject:Connector/J commit: r4122 - branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional
View as plain text  
Modified:
  
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java
  
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlConnectionPoolDataSource.java
  
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlPooledConnection.java
Log:
Made Connection.clientPrepare() available from "wrapped" connections
	  in the jdbc2.optional package (connections built by 
	  ConnectionPoolDataSource instances).

Modified:
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java
===================================================================
---
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java	2005-08-23
00:07:24 UTC (rev 4121)
+++
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java	2005-08-23
03:24:03 UTC (rev 4122)
@@ -52,7 +52,7 @@
  * @see org.gjt.mm.mysql.jdbc2.optional.MysqlPooledConnection
  */
 public class ConnectionWrapper extends WrapperBase implements Connection {
-	private Connection mc = null;
+	private com.mysql.jdbc.Connection mc = null;
 
 	private MysqlPooledConnection mpc = null;
 
@@ -72,7 +72,7 @@
 	 *             if an error occurs.
 	 */
 	public ConnectionWrapper(MysqlPooledConnection mysqlPooledConnection,
-			Connection mysqlConnection) throws SQLException {
+			com.mysql.jdbc.Connection mysqlConnection) throws SQLException {
 		this.mpc = mysqlPooledConnection;
 		this.mc = mysqlConnection;
 		this.closed = false;
@@ -159,6 +159,10 @@
 	public boolean isClosed() throws SQLException {
 		return (this.closed || this.mc.isClosed());
 	}
+	
+	public boolean isMasterConnection() throws SQLException {
+		return this.mc.isMasterConnection();
+	}
 
 	/**
 	 * @see Connection#setHoldability(int)
@@ -195,7 +199,7 @@
 	 * @return how long the connection has been idle.
 	 */
 	public long getIdleFor() {
-		return ((com.mysql.jdbc.Connection) this.mc).getIdleFor();
+		return this.mc.getIdleFor();
 	}
 
 	/**
@@ -555,7 +559,7 @@
 
 		try {
 			return new PreparedStatementWrapper(this, this.mpc, 
-					((com.mysql.jdbc.Connection)this.mc).clientPrepareStatement(sql));
+					this.mc.clientPrepareStatement(sql));
 		} catch (SQLException sqlException) {
 			checkAndFireConnectionError(sqlException);
 		}
@@ -570,7 +574,7 @@
 
 		try {
 			return new PreparedStatementWrapper(this, this.mpc, 
-					((com.mysql.jdbc.Connection)this.mc).clientPrepareStatement(sql,
+					this.mc.clientPrepareStatement(sql,
 							resultSetType, resultSetConcurrency));
 		} catch (SQLException sqlException) {
 			checkAndFireConnectionError(sqlException);
@@ -735,8 +739,7 @@
 				return;
 			}
 
-			if (((com.mysql.jdbc.Connection) this.mc)
-					.getRollbackOnPooledClose()
+			if (this.mc.getRollbackOnPooledClose()
 					&& !this.getAutoCommit()) {
 				rollback();
 			}

Modified:
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlConnectionPoolDataSource.java
===================================================================
---
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlConnectionPoolDataSource.java	2005-08-23
00:07:24 UTC (rev 4121)
+++
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlConnectionPoolDataSource.java	2005-08-23
03:24:03 UTC (rev 4122)
@@ -57,7 +57,7 @@
 			throws SQLException {
 		Connection connection = getConnection();
 		MysqlPooledConnection mysqlPooledConnection = new MysqlPooledConnection(
-				connection);
+				(com.mysql.jdbc.Connection)connection);
 
 		return mysqlPooledConnection;
 	}
@@ -78,7 +78,7 @@
 			throws SQLException {
 		Connection connection = getConnection(s, s1);
 		MysqlPooledConnection mysqlPooledConnection = new MysqlPooledConnection(
-				connection);
+				(com.mysql.jdbc.Connection)connection);
 
 		return mysqlPooledConnection;
 	}

Modified:
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlPooledConnection.java
===================================================================
---
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlPooledConnection.java	2005-08-23
00:07:24 UTC (rev 4121)
+++
branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlPooledConnection.java	2005-08-23
03:24:03 UTC (rev 4122)
@@ -61,7 +61,7 @@
 
 	private Connection logicalHandle;
 
-	private Connection physicalConn;
+	private com.mysql.jdbc.Connection physicalConn;
 
 	// ~ Constructors ..........................................................
 
@@ -71,7 +71,7 @@
 	 * @param connection
 	 *            physical connection to db
 	 */
-	public MysqlPooledConnection(Connection connection) {
+	public MysqlPooledConnection(com.mysql.jdbc.Connection connection) {
 		this.logicalHandle = null;
 		this.physicalConn = connection;
 		this.eventListeners = new Hashtable(10);

Thread
Connector/J commit: r4122 - branches/branch_3_1/connector-j/src/com/mysql/jdbc/jdbc2/optionalmmatthews23 Aug