Added:
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4CallableStatementWrapper.java
Modified:
trunk/
trunk/connector-j/src/com/mysql/jdbc/CallableStatement.java
trunk/connector-j/src/com/mysql/jdbc/Connection.java
trunk/connector-j/src/com/mysql/jdbc/ConnectionImpl.java
trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java
trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java
trunk/connector-j/src/com/mysql/jdbc/JDBC4CallableStatement.java
trunk/connector-j/src/com/mysql/jdbc/JDBC4DatabaseMetaData.java
trunk/connector-j/src/com/mysql/jdbc/JDBC4ServerPreparedStatement.java
trunk/connector-j/src/com/mysql/jdbc/MysqlIO.java
trunk/connector-j/src/com/mysql/jdbc/UpdatableResultSet.java
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/CallableStatementWrapper.java
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4PreparedStatementWrapper.java
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4StatementWrapper.java
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/PreparedStatementWrapper.java
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/StatementWrapper.java
trunk/connector-j/src/testsuite/simple/ConnectionTest.java
Log:
Merged revisions 6585-6586,6593-6597,6599-6602,6605,6607-6609,6612-6615 via svnmerge from
svn+ssh://mmatthews@stripped/connectors-svnroot/connector-j/branches/branch_5_1
.......
r6613 | mmatthews | 2007-10-04 11:56:05 -0500 (Thu, 04 Oct 2007) | 2 lines
JDBC-4.0-ize the wrappers for ConnectionPoolDataSource, and add a interface
implementation test...Oddly enough the Java compiler doesn't re-check already compiled
classes to make sure they implement all methods in an interface. Our JDBC-4.0
implementations extend
classes that were compiled with a compiler that only knows JDBC-3.0, and thus any
missing methods show up at runtime, not compile time.
.......
Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
- /branches/branch_5_0:1-6614 /branches/branch_5_1:1-6582,6584-6611
+ /branches/branch_5_0:1-6614 /branches/branch_5_1:1-6582,6584-6615
Modified: trunk/connector-j/src/com/mysql/jdbc/CallableStatement.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/CallableStatement.java 2007-10-04 19:50:37 UTC
(rev 6615)
+++ trunk/connector-j/src/com/mysql/jdbc/CallableStatement.java 2007-10-04 19:57:22 UTC
(rev 6616)
@@ -2061,7 +2061,7 @@
PreparedStatement setPstmt = null;
try {
- setPstmt = this.connection
+ setPstmt = (PreparedStatement) this.connection
.clientPrepareStatement(queryBuf.toString());
byte[] parameterAsBytes = getBytesRepresentation(
Modified: trunk/connector-j/src/com/mysql/jdbc/Connection.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/Connection.java 2007-10-04 19:50:37 UTC (rev
6615)
+++ trunk/connector-j/src/com/mysql/jdbc/Connection.java 2007-10-04 19:57:22 UTC (rev
6616)
@@ -68,7 +68,7 @@
*
* @see java.sql.Connection#prepareStatement(String)
*/
- public abstract PreparedStatement clientPrepareStatement(String sql)
+ public abstract java.sql.PreparedStatement clientPrepareStatement(String sql)
throws SQLException;
/**
@@ -90,7 +90,7 @@
*
* @see java.sql.Connection#prepareStatement(String, int, int)
*/
- public abstract PreparedStatement clientPrepareStatement(String sql,
+ public abstract java.sql.PreparedStatement clientPrepareStatement(String sql,
int resultSetType, int resultSetConcurrency) throws SQLException;
/**
@@ -110,6 +110,18 @@
* with the same semantics as the java.sql.Connection.prepareStatement()
* method with the same argument types.
*
+ * @see java.sql.Connection#prepareStatement(String, int, int, int)
+ */
+ public abstract java.sql.PreparedStatement clientPrepareStatement(String sql,
+ int resultSetType, int resultSetConcurrency,
+ int resultSetHoldability) throws SQLException;
+
+ /**
+ * Prepares a statement on the client, using client-side emulation
+ * (irregardless of the configuration property 'useServerPrepStmts')
+ * with the same semantics as the java.sql.Connection.prepareStatement()
+ * method with the same argument types.
+ *
* @see java.sql.Connection#prepareStatement(String, String[])
*/
public abstract java.sql.PreparedStatement clientPrepareStatement(String sql,
@@ -231,7 +243,7 @@
*
* @see java.sql.Connection#prepareStatement(String)
*/
- public abstract ServerPreparedStatement serverPrepareStatement(String sql)
+ public abstract java.sql.PreparedStatement serverPrepareStatement(String sql)
throws SQLException;
/**
Modified: trunk/connector-j/src/com/mysql/jdbc/ConnectionImpl.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/ConnectionImpl.java 2007-10-04 19:50:37 UTC (rev
6615)
+++ trunk/connector-j/src/com/mysql/jdbc/ConnectionImpl.java 2007-10-04 19:57:22 UTC (rev
6616)
@@ -1290,7 +1290,7 @@
* @throws SQLException
* DOCUMENT ME!
*/
- public PreparedStatement clientPrepareStatement(String sql)
+ public java.sql.PreparedStatement clientPrepareStatement(String sql)
throws SQLException {
return clientPrepareStatement(sql,
java.sql.ResultSet.TYPE_SCROLL_SENSITIVE,
@@ -1323,14 +1323,14 @@
* @throws SQLException
* DOCUMENT ME!
*/
- public PreparedStatement clientPrepareStatement(String sql,
+ public java.sql.PreparedStatement clientPrepareStatement(String sql,
int resultSetType, int resultSetConcurrency) throws SQLException {
return clientPrepareStatement(sql, resultSetType, resultSetConcurrency, true);
}
- protected PreparedStatement clientPrepareStatement(String sql,
+ protected java.sql.PreparedStatement clientPrepareStatement(String sql,
int resultSetType, int resultSetConcurrency,
boolean processEscapeCodesIfNeeded) throws SQLException {
checkClosed();
@@ -1400,7 +1400,7 @@
public java.sql.PreparedStatement clientPrepareStatement(String sql,
int[] autoGenKeyIndexes) throws SQLException {
- PreparedStatement pStmt = clientPrepareStatement(sql);
+ PreparedStatement pStmt = (PreparedStatement) clientPrepareStatement(sql);
pStmt
.setRetrieveGeneratedKeys((autoGenKeyIndexes != null)
@@ -1414,7 +1414,7 @@
*/
public java.sql.PreparedStatement clientPrepareStatement(String sql,
String[] autoGenKeyColNames) throws SQLException {
- PreparedStatement pStmt = clientPrepareStatement(sql);
+ PreparedStatement pStmt = (PreparedStatement) clientPrepareStatement(sql);
pStmt
.setRetrieveGeneratedKeys((autoGenKeyColNames != null)
@@ -1423,6 +1423,12 @@
return pStmt;
}
+ public java.sql.PreparedStatement clientPrepareStatement(String sql,
+ int resultSetType, int resultSetConcurrency,
+ int resultSetHoldability) throws SQLException {
+ return clientPrepareStatement(sql, resultSetType, resultSetConcurrency, true);
+ }
+
// --------------------------JDBC 2.0-----------------------------
/**
@@ -4068,7 +4074,7 @@
} catch (SQLException sqlEx) {
// Punt, if necessary
if (getEmulateUnsupportedPstmts()) {
- pStmt = clientPrepareStatement(nativeSql, resultSetType, resultSetConcurrency,
false);
+ pStmt = (PreparedStatement) clientPrepareStatement(nativeSql, resultSetType,
resultSetConcurrency, false);
if (sql.length() < getPreparedStatementCacheSqlLimit()) {
this.serverSideStatementCheckCache.put(sql, Boolean.FALSE);
@@ -4089,14 +4095,14 @@
} catch (SQLException sqlEx) {
// Punt, if necessary
if (getEmulateUnsupportedPstmts()) {
- pStmt = clientPrepareStatement(nativeSql, resultSetType, resultSetConcurrency,
false);
+ pStmt = (PreparedStatement) clientPrepareStatement(nativeSql, resultSetType,
resultSetConcurrency, false);
} else {
throw sqlEx;
}
}
}
} else {
- pStmt = clientPrepareStatement(nativeSql, resultSetType, resultSetConcurrency, false);
+ pStmt = (PreparedStatement) clientPrepareStatement(nativeSql, resultSetType,
resultSetConcurrency, false);
}
return pStmt;
@@ -4668,7 +4674,7 @@
/**
* @see java.sql.Connection#prepareStatement(String)
*/
- public ServerPreparedStatement serverPrepareStatement(String sql)
+ public java.sql.PreparedStatement serverPrepareStatement(String sql)
throws SQLException {
String nativeSql = getProcessEscapeCodesForPrepStmts() ? nativeSQL(sql): sql;
@@ -4730,7 +4736,7 @@
public java.sql.PreparedStatement serverPrepareStatement(String sql,
int[] autoGenKeyIndexes) throws SQLException {
- PreparedStatement pStmt = serverPrepareStatement(sql);
+ PreparedStatement pStmt = (PreparedStatement) serverPrepareStatement(sql);
pStmt
.setRetrieveGeneratedKeys((autoGenKeyIndexes != null)
@@ -4744,7 +4750,7 @@
*/
public java.sql.PreparedStatement serverPrepareStatement(String sql,
String[] autoGenKeyColNames) throws SQLException {
- PreparedStatement pStmt = serverPrepareStatement(sql);
+ PreparedStatement pStmt = (PreparedStatement) serverPrepareStatement(sql);
pStmt
.setRetrieveGeneratedKeys((autoGenKeyColNames != null)
Modified: trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java 2007-10-04 19:50:37 UTC
(rev 6615)
+++ trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java 2007-10-04 19:57:22 UTC
(rev 6616)
@@ -732,7 +732,7 @@
byte[][] rowData = null;
- if (fields != null && fields.length == 8) {
+ if (fields != null && fields.length == 9) {
rowData = new byte[8][];
rowData[0] = catalog == null ? null : s2b(catalog); // PROCEDURE_CAT
@@ -743,6 +743,7 @@
rowData[5] = null; // reserved3
rowData[6] = s2b(proceduresRs.getString("comment")); // REMARKS
rowData[7] = s2b(Integer.toString(procedureReturnsResult)); // PROCEDURE_TYPE
+ rowData[8] = s2b(functionName);
} else {
rowData = new byte[6][];
@@ -784,7 +785,7 @@
if (shouldAdd) {
String procedureName = proceduresRs.getString(nameIndex);
- byte[][] rowData = new byte[8][];
+ byte[][] rowData = new byte[9][];
rowData[0] = catalog == null ? null : s2b(catalog);
rowData[1] = null;
rowData[2] = s2b(procedureName);
@@ -800,6 +801,8 @@
.toString(procedureReturnsResult) : Integer
.toString(procedureResultUnknown));
+ rowData[8] = s2b(procedureName);
+
procedureRowsOrderedByName.put(procedureName, new ByteArrayRow(rowData));
}
}
@@ -4161,15 +4164,17 @@
}
private Field[] createFieldMetadataForGetProcedures() {
- Field[] fields = new Field[8];
- fields[0] = new Field("", "PROCEDURE_CAT", Types.CHAR, 0);
- fields[1] = new Field("", "PROCEDURE_SCHEM", Types.CHAR, 0);
- fields[2] = new Field("", "PROCEDURE_NAME", Types.CHAR, 0);
+ Field[] fields = new Field[9];
+ fields[0] = new Field("", "PROCEDURE_CAT", Types.CHAR, 255);
+ fields[1] = new Field("", "PROCEDURE_SCHEM", Types.CHAR, 255);
+ fields[2] = new Field("", "PROCEDURE_NAME", Types.CHAR, 255);
fields[3] = new Field("", "reserved1", Types.CHAR, 0);
fields[4] = new Field("", "reserved2", Types.CHAR, 0);
fields[5] = new Field("", "reserved3", Types.CHAR, 0);
- fields[6] = new Field("", "REMARKS", Types.CHAR, 0);
- fields[7] = new Field("", "PROCEDURE_TYPE", Types.SMALLINT, 0);
+ fields[6] = new Field("", "REMARKS", Types.CHAR, 255);
+ fields[7] = new Field("", "PROCEDURE_TYPE", Types.SMALLINT, 6);
+ fields[8] = new Field("", "SPECIFIC_NAME", Types.CHAR, 255);
+
return fields;
}
@@ -4205,7 +4210,7 @@
boolean fromSelect = false;
ResultSet proceduresRs = null;
boolean needsClientFiltering = true;
- PreparedStatement proceduresStmt = conn
+ PreparedStatement proceduresStmt = (PreparedStatement) conn
.clientPrepareStatement("SELECT name, type, comment FROM mysql.proc WHERE name
like ? and db <=> ? ORDER BY name");
try {
@@ -4252,7 +4257,7 @@
nameIndex = 1;
}
- proceduresStmt = conn
+ proceduresStmt = (PreparedStatement) conn
.clientPrepareStatement("SHOW PROCEDURE STATUS LIKE ?");
if (proceduresStmt.getMaxRows() != 0) {
@@ -4276,7 +4281,7 @@
proceduresStmt.close();
}
- proceduresStmt = conn
+ proceduresStmt = (PreparedStatement) conn
.clientPrepareStatement("SHOW FUNCTION STATUS LIKE ?");
if (proceduresStmt.getMaxRows() != 0) {
Modified: trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java 2007-10-04
19:50:37 UTC (rev 6615)
+++ trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaDataUsingInfoSchema.java 2007-10-04
19:57:22 UTC (rev 6616)
@@ -1228,7 +1228,7 @@
throws SQLException {
// Can't use server-side here as we coerce a lot of types to match
// the spec.
- PreparedStatement pStmt = this.conn.clientPrepareStatement(sql);
+ PreparedStatement pStmt = (PreparedStatement) this.conn.clientPrepareStatement(sql);
if (pStmt.getMaxRows() != 0) {
pStmt.setMaxRows(0);
Modified: trunk/connector-j/src/com/mysql/jdbc/JDBC4CallableStatement.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/JDBC4CallableStatement.java 2007-10-04 19:50:37
UTC (rev 6615)
+++ trunk/connector-j/src/com/mysql/jdbc/JDBC4CallableStatement.java 2007-10-04 19:57:22
UTC (rev 6616)
@@ -36,51 +36,68 @@
public class JDBC4CallableStatement extends CallableStatement {
- public JDBC4CallableStatement(ConnectionImpl conn, CallableStatementParamInfo paramInfo)
throws SQLException {
+ public JDBC4CallableStatement(ConnectionImpl conn,
+ CallableStatementParamInfo paramInfo) throws SQLException {
super(conn, paramInfo);
}
-
- public JDBC4CallableStatement(ConnectionImpl conn, String sql, String catalog,
- boolean isFunctionCall) throws SQLException {
+
+ public JDBC4CallableStatement(ConnectionImpl conn, String sql,
+ String catalog, boolean isFunctionCall) throws SQLException {
super(conn, sql, catalog, isFunctionCall);
}
+
+ public void setRowId(int parameterIndex, RowId x) throws SQLException {
+ JDBC4PreparedStatementHelper.setRowId(this, parameterIndex, x);
+ }
+
public void setRowId(String parameterName, RowId x) throws SQLException {
- JDBC4PreparedStatementHelper.setRowId(this, getNamedParamIndex(parameterName, false),
x);
+ JDBC4PreparedStatementHelper.setRowId(this, getNamedParamIndex(
+ parameterName, false), x);
}
- public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
- JDBC4PreparedStatementHelper.setSQLXML(this, getNamedParamIndex(parameterName, false),
xmlObject);
-
+ public void setSQLXML(int parameterIndex, SQLXML xmlObject)
+ throws SQLException {
+ JDBC4PreparedStatementHelper.setSQLXML(this, parameterIndex, xmlObject);
}
-
+
+ public void setSQLXML(String parameterName, SQLXML xmlObject)
+ throws SQLException {
+ JDBC4PreparedStatementHelper.setSQLXML(this, getNamedParamIndex(
+ parameterName, false), xmlObject);
+
+ }
+
public SQLXML getSQLXML(int parameterIndex) throws SQLException {
ResultSetInternalMethods rs = getOutputParameters(parameterIndex);
- SQLXML retValue = ((com.mysql.jdbc.JDBC4ResultSet)rs)
+ SQLXML retValue = ((com.mysql.jdbc.JDBC4ResultSet) rs)
.getSQLXML(mapOutputParameterIndexToRsIndex(parameterIndex));
this.outputParamWasNull = rs.wasNull();
return retValue;
-
+
}
public SQLXML getSQLXML(String parameterName) throws SQLException {
- ResultSetInternalMethods rs = getOutputParameters(0); // definitely not going to be
+ ResultSetInternalMethods rs = getOutputParameters(0); // definitely
+ // not going to
+ // be
// from ?=
- SQLXML retValue =
((com.mysql.jdbc.JDBC4ResultSet)rs).getSQLXML(fixParameterName(parameterName));
+ SQLXML retValue = ((com.mysql.jdbc.JDBC4ResultSet) rs)
+ .getSQLXML(fixParameterName(parameterName));
this.outputParamWasNull = rs.wasNull();
return retValue;
}
-
+
public RowId getRowId(int parameterIndex) throws SQLException {
ResultSetInternalMethods rs = getOutputParameters(parameterIndex);
- RowId retValue = ((com.mysql.jdbc.JDBC4ResultSet)rs)
+ RowId retValue = ((com.mysql.jdbc.JDBC4ResultSet) rs)
.getRowId(mapOutputParameterIndexToRsIndex(parameterIndex));
this.outputParamWasNull = rs.wasNull();
@@ -89,73 +106,86 @@
}
public RowId getRowId(String parameterName) throws SQLException {
- ResultSetInternalMethods rs = getOutputParameters(0); // definitely not going to be
- // from ?=
-
- RowId retValue =
((com.mysql.jdbc.JDBC4ResultSet)rs).getRowId(fixParameterName(parameterName));
-
- this.outputParamWasNull = rs.wasNull();
-
- return retValue;
+ ResultSetInternalMethods rs = getOutputParameters(0); // definitely
+ // not going to
+ // be
+ // from ?=
+
+ RowId retValue = ((com.mysql.jdbc.JDBC4ResultSet) rs)
+ .getRowId(fixParameterName(parameterName));
+
+ this.outputParamWasNull = rs.wasNull();
+
+ return retValue;
}
-
+
+ /**
+ * JDBC 4.0 Set a NCLOB parameter.
+ *
+ * @param i
+ * the first parameter is 1, the second is 2, ...
+ * @param x
+ * an object representing a NCLOB
+ *
+ * @throws SQLException
+ * if a database error occurs
+ */
+ public void setNClob(int parameterIndex, NClob value) throws SQLException {
+ JDBC4PreparedStatementHelper.setNClob(this, parameterIndex, value);
+ }
+
public void setNClob(String parameterName, NClob value) throws SQLException {
- JDBC4PreparedStatementHelper.setNClob(this, getNamedParamIndex(parameterName, false),
value);
-
+ JDBC4PreparedStatementHelper.setNClob(this, getNamedParamIndex(
+ parameterName, false), value);
+
}
- public void setNClob(String parameterName, Reader reader) throws SQLException {
+ public void setNClob(String parameterName, Reader reader)
+ throws SQLException {
setNClob(getNamedParamIndex(parameterName, false), reader);
-
+
}
- public void setNClob(String parameterName, Reader reader, long length) throws
SQLException {
+ public void setNClob(String parameterName, Reader reader, long length)
+ throws SQLException {
setNClob(getNamedParamIndex(parameterName, false), reader, length);
-
+
}
- public void setNString(String parameterName, String value) throws SQLException {
+ public void setNString(String parameterName, String value)
+ throws SQLException {
setNString(getNamedParamIndex(parameterName, false), value);
}
-
-
- public boolean isWrapperFor(Class arg0) throws SQLException {
- throw new NotYetImplementedException();
-
- }
-
- public Object unwrap(Class arg0) throws SQLException {
- throw new NotYetImplementedException();
-
- }
-
/**
* @see java.sql.CallableStatement#getCharacterStream(int)
*/
public Reader getCharacterStream(int parameterIndex) throws SQLException {
ResultSetInternalMethods rs = getOutputParameters(parameterIndex);
-
- Reader retValue = rs
- .getCharacterStream(mapOutputParameterIndexToRsIndex(parameterIndex));
-
- this.outputParamWasNull = rs.wasNull();
-
- return retValue;
+
+ Reader retValue = rs
+ .getCharacterStream(mapOutputParameterIndexToRsIndex(parameterIndex));
+
+ this.outputParamWasNull = rs.wasNull();
+
+ return retValue;
}
/**
* @see java.sql.CallableStatement#getCharacterStream(java.lang.String)
*/
public Reader getCharacterStream(String parameterName) throws SQLException {
- ResultSetInternalMethods rs = getOutputParameters(0); // definitely not going to be
- // from ?=
-
- Reader retValue = rs.getCharacterStream(fixParameterName(parameterName));
-
- this.outputParamWasNull = rs.wasNull();
-
- return retValue;
+ ResultSetInternalMethods rs = getOutputParameters(0); // definitely
+ // not going to
+ // be
+ // from ?=
+
+ Reader retValue = rs
+ .getCharacterStream(fixParameterName(parameterName));
+
+ this.outputParamWasNull = rs.wasNull();
+
+ return retValue;
}
/**
@@ -163,27 +193,30 @@
*/
public Reader getNCharacterStream(int parameterIndex) throws SQLException {
ResultSetInternalMethods rs = getOutputParameters(parameterIndex);
-
- Reader retValue = ((com.mysql.jdbc.JDBC4ResultSet)rs)
- .getNCharacterStream(mapOutputParameterIndexToRsIndex(parameterIndex));
-
- this.outputParamWasNull = rs.wasNull();
-
- return retValue;
+
+ Reader retValue = ((com.mysql.jdbc.JDBC4ResultSet) rs)
+ .getNCharacterStream(mapOutputParameterIndexToRsIndex(parameterIndex));
+
+ this.outputParamWasNull = rs.wasNull();
+
+ return retValue;
}
/**
* @see java.sql.CallableStatement#getNCharacterStream(java.lang.String)
*/
public Reader getNCharacterStream(String parameterName) throws SQLException {
- ResultSetInternalMethods rs = getOutputParameters(0); // definitely not going to be
- // from ?=
-
- Reader retValue =
((com.mysql.jdbc.JDBC4ResultSet)rs).getNCharacterStream(fixParameterName(parameterName));
-
- this.outputParamWasNull = rs.wasNull();
-
- return retValue;
+ ResultSetInternalMethods rs = getOutputParameters(0); // definitely
+ // not going to
+ // be
+ // from ?=
+
+ Reader retValue = ((com.mysql.jdbc.JDBC4ResultSet) rs)
+ .getNCharacterStream(fixParameterName(parameterName));
+
+ this.outputParamWasNull = rs.wasNull();
+
+ return retValue;
}
/**
@@ -191,27 +224,30 @@
*/
public NClob getNClob(int parameterIndex) throws SQLException {
ResultSetInternalMethods rs = getOutputParameters(parameterIndex);
-
- NClob retValue = ((com.mysql.jdbc.JDBC4ResultSet)rs)
- .getNClob(mapOutputParameterIndexToRsIndex(parameterIndex));
-
- this.outputParamWasNull = rs.wasNull();
-
- return retValue;
+
+ NClob retValue = ((com.mysql.jdbc.JDBC4ResultSet) rs)
+ .getNClob(mapOutputParameterIndexToRsIndex(parameterIndex));
+
+ this.outputParamWasNull = rs.wasNull();
+
+ return retValue;
}
/**
* @see java.sql.CallableStatement#getNClob(java.lang.String)
*/
public NClob getNClob(String parameterName) throws SQLException {
- ResultSetInternalMethods rs = getOutputParameters(0); // definitely not going to be
- // from ?=
-
- NClob retValue =
((com.mysql.jdbc.JDBC4ResultSet)rs).getNClob(fixParameterName(parameterName));
-
- this.outputParamWasNull = rs.wasNull();
-
- return retValue;
+ ResultSetInternalMethods rs = getOutputParameters(0); // definitely
+ // not going to
+ // be
+ // from ?=
+
+ NClob retValue = ((com.mysql.jdbc.JDBC4ResultSet) rs)
+ .getNClob(fixParameterName(parameterName));
+
+ this.outputParamWasNull = rs.wasNull();
+
+ return retValue;
}
/**
@@ -219,26 +255,29 @@
*/
public String getNString(int parameterIndex) throws SQLException {
ResultSetInternalMethods rs = getOutputParameters(parameterIndex);
-
- String retValue = ((com.mysql.jdbc.JDBC4ResultSet)rs)
- .getNString(mapOutputParameterIndexToRsIndex(parameterIndex));
-
- this.outputParamWasNull = rs.wasNull();
-
- return retValue;
+
+ String retValue = ((com.mysql.jdbc.JDBC4ResultSet) rs)
+ .getNString(mapOutputParameterIndexToRsIndex(parameterIndex));
+
+ this.outputParamWasNull = rs.wasNull();
+
+ return retValue;
}
/**
* @see java.sql.CallableStatement#getNString(java.lang.String)
*/
public String getNString(String parameterName) throws SQLException {
- ResultSetInternalMethods rs = getOutputParameters(0); // definitely not going to be
- // from ?=
-
- String retValue =
((com.mysql.jdbc.JDBC4ResultSet)rs).getNString(fixParameterName(parameterName));
-
- this.outputParamWasNull = rs.wasNull();
-
- return retValue;
+ ResultSetInternalMethods rs = getOutputParameters(0); // definitely
+ // not going to
+ // be
+ // from ?=
+
+ String retValue = ((com.mysql.jdbc.JDBC4ResultSet) rs)
+ .getNString(fixParameterName(parameterName));
+
+ this.outputParamWasNull = rs.wasNull();
+
+ return retValue;
}
}
Modified: trunk/connector-j/src/com/mysql/jdbc/JDBC4DatabaseMetaData.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/JDBC4DatabaseMetaData.java 2007-10-04 19:50:37
UTC (rev 6615)
+++ trunk/connector-j/src/com/mysql/jdbc/JDBC4DatabaseMetaData.java 2007-10-04 19:57:22
UTC (rev 6616)
@@ -31,6 +31,8 @@
import java.util.List;
+import com.mysql.jdbc.Field;
+
public class JDBC4DatabaseMetaData extends DatabaseMetaData {
public JDBC4DatabaseMetaData(ConnectionImpl connToSet, String databaseToSet) {
super(connToSet, databaseToSet);
@@ -86,6 +88,116 @@
}
}
+ /**
+ * Retrieves a list of the client info properties
+ * that the driver supports. The result set contains the following columns
+ * <p>
+ * <ol>
+ * <li><b>NAME</b> String=> The name of the client info
property<br>
+ * <li><b>MAX_LEN</b> int=> The maximum length of the value for the
property<br>
+ * <li><b>DEFAULT_VALUE</b> String=> The default value of the
property<br>
+ * <li><b>DESCRIPTION</b> String=> A description of the property.
This will typically
+ * contain information as to where this property is
+ * stored in the database.
+ * </ol>
+ * <p>
+ * The <code>ResultSet</code> is sorted by the NAME column
+ * <p>
+ * @return A <code>ResultSet</code> object; each row is a supported client
info
+ * property
+ * <p>
+ * @exception SQLException if a database access error occurs
+ * <p>
+ * @since 1.6
+ */
+ public ResultSet getClientInfoProperties()
+ throws SQLException {
+ // We don't have any built-ins, we actually support whatever
+ // the client wants to provide, however we don't have a way
+ // to express this with the interface given
+ Field[] fields = new Field[4];
+ fields[0] = new Field("", "NAME", Types.VARCHAR, 255);
+ fields[1] = new Field("", "MAX_LEN", Types.INTEGER, 10);
+ fields[2] = new Field("", "DEFAULT_VALUE", Types.VARCHAR, 255);
+ fields[3] = new Field("", "DESCRIPTION", Types.VARCHAR, 255);
+
+ ArrayList tuples = new ArrayList();
+
+ return buildResultSet(fields, tuples, this.conn);
+ }
+
+ public boolean autoCommitFailureClosesAllResultSets() throws SQLException {
+ return false;
+ }
+
+ /**
+ * Retrieves a description of the system and user functions available
+ * in the given catalog.
+ * <P>
+ * Only system and user function descriptions matching the schema and
+ * function name criteria are returned. They are ordered by
+ * <code>FUNCTION_CAT</code>, <code>FUNCTION_SCHEM</code>,
+ * <code>FUNCTION_NAME</code> and
+ * <code>SPECIFIC_ NAME</code>.
+ *
+ * <P>Each function description has the the following columns:
+ * <OL>
+ * <LI><B>FUNCTION_CAT</B> String => function catalog (may be
<code>null</code>)
+ * <LI><B>FUNCTION_SCHEM</B> String => function schema (may be
<code>null</code>)
+ * <LI><B>FUNCTION_NAME</B> String => function name. This is
the name
+ * used to invoke the function
+ * <LI><B>REMARKS</B> String => explanatory comment on the
function
+ * <LI><B>FUNCTION_TYPE</B> short => kind of function:
+ * <UL>
+ * <LI>functionResultUnknown - Cannot determine if a return value
+ * or table will be returned
+ * <LI> functionNoTable- Does not return a table
+ * <LI> functionReturnsTable - Returns a table
+ * </UL>
+ * <LI><B>SPECIFIC_NAME</B> String => the name which uniquely
identifies
+ * this function within its schema. This is a user specified, or DBMS
+ * generated, name that may be different then the
<code>FUNCTION_NAME</code>
+ * for example with overload functions
+ * </OL>
+ * <p>
+ * A user may not have permission to execute any of the functions that are
+ * returned by <code>getFunctions</code>
+ *
+ * @param catalog a catalog name; must match the catalog name as it
+ * is stored in the database; "" retrieves those without a catalog;
+ * <code>null</code> means that the catalog name should not be
used to narrow
+ * the search
+ * @param schemaPattern a schema name pattern; must match the schema name
+ * as it is stored in the database; "" retrieves those without a schema;
+ * <code>null</code> means that the schema name should not be used
to narrow
+ * the search
+ * @param functionNamePattern a function name pattern; must match the
+ * function name as it is stored in the database
+ * @return <code>ResultSet</code> - each row is a function description
+ * @exception SQLException if a database access error occurs
+ * @see #getSearchStringEscape
+ * @since 1.6
+ */
+ public java.sql.ResultSet getFunctions(String catalog, String schemaPattern,
+ String functionNamePattern) throws SQLException {
+ Field[] fields = new Field[6];
+
+ fields[0] = new Field("", "FUNCTION_CAT", Types.CHAR, 255);
+ fields[1] = new Field("", "FUNCTION_SCHEM", Types.CHAR, 255);
+ fields[2] = new Field("", "FUNCTION_NAME", Types.CHAR, 255);
+ fields[3] = new Field("", "REMARKS", Types.CHAR, 255);
+ fields[4] = new Field("", "FUNCTION_TYPE", Types.SMALLINT, 6);
+ fields[5] = new Field("", "SPECIFIC_NAME", Types.CHAR, 255);
+
+ return getProceduresAndOrFunctions(
+ fields,
+ catalog,
+ schemaPattern,
+ functionNamePattern,
+ false,
+ true);
+ }
+
protected int getJDBC4FunctionNoTableConstant() {
return functionNoTable;
}
Modified: trunk/connector-j/src/com/mysql/jdbc/JDBC4ServerPreparedStatement.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/JDBC4ServerPreparedStatement.java 2007-10-04
19:50:37 UTC (rev 6615)
+++ trunk/connector-j/src/com/mysql/jdbc/JDBC4ServerPreparedStatement.java 2007-10-04
19:57:22 UTC (rev 6616)
@@ -25,6 +25,7 @@
import java.io.Reader;
import java.sql.NClob;
+import java.sql.RowId;
import java.sql.SQLXML;
import java.sql.SQLException;
@@ -36,54 +37,55 @@
public class JDBC4ServerPreparedStatement extends ServerPreparedStatement {
- public JDBC4ServerPreparedStatement(ConnectionImpl conn, String sql, String catalog, int
resultSetType, int resultSetConcurrency) throws SQLException {
+ public JDBC4ServerPreparedStatement(ConnectionImpl conn, String sql,
+ String catalog, int resultSetType, int resultSetConcurrency)
+ throws SQLException {
super(conn, sql, catalog, resultSetType, resultSetConcurrency);
// TODO Auto-generated constructor stub
}
- /**
- * @see java.sql.PreparedStatement#setNCharacterStream(int, java.io.Reader,
- * long)
- */
- public void setNCharacterStream(int parameterIndex, Reader reader, long length)
- throws SQLException {
- // can't take if characterEncoding isn't utf8
- if (!this.charEncoding.equalsIgnoreCase("UTF-8")
- && !this.charEncoding.equalsIgnoreCase("utf8")) {
- throw SQLError.createSQLException(
- "Can not call setNCharacterStream() when connection character set isn't
UTF-8");
- }
-
- checkClosed();
-
- if (reader == null) {
- setNull(parameterIndex, java.sql.Types.BINARY);
- } else {
- BindValue binding = getBinding(parameterIndex, true);
- setType(binding, MysqlDefs.FIELD_TYPE_BLOB);
+ /**
+ * @see java.sql.PreparedStatement#setNCharacterStream(int, java.io.Reader,
+ * long)
+ */
+ public void setNCharacterStream(int parameterIndex, Reader reader,
+ long length) throws SQLException {
+ // can't take if characterEncoding isn't utf8
+ if (!this.charEncoding.equalsIgnoreCase("UTF-8")
+ && !this.charEncoding.equalsIgnoreCase("utf8")) {
+ throw SQLError
+ .createSQLException("Can not call setNCharacterStream() when connection character
set isn't UTF-8");
+ }
- binding.value = reader;
- binding.isNull = false;
- binding.isLongData = true;
+ checkClosed();
- if (this.connection.getUseStreamLengthsInPrepStmts()) {
- binding.bindLength = length;
- } else {
- binding.bindLength = -1;
- }
- }
- }
+ if (reader == null) {
+ setNull(parameterIndex, java.sql.Types.BINARY);
+ } else {
+ BindValue binding = getBinding(parameterIndex, true);
+ setType(binding, MysqlDefs.FIELD_TYPE_BLOB);
- /**
- * @see java.sql.PreparedStatement#setNClob(int, java.sql.NClob)
- */
- public void setNClob(int parameterIndex, NClob x) throws SQLException {
- setNClob(parameterIndex, x.getCharacterStream(),
- this.connection.getUseStreamLengthsInPrepStmts()
- ? x.length() : -1);
- }
+ binding.value = reader;
+ binding.isNull = false;
+ binding.isLongData = true;
+ if (this.connection.getUseStreamLengthsInPrepStmts()) {
+ binding.bindLength = length;
+ } else {
+ binding.bindLength = -1;
+ }
+ }
+ }
+
/**
+ * @see java.sql.PreparedStatement#setNClob(int, java.sql.NClob)
+ */
+ public void setNClob(int parameterIndex, NClob x) throws SQLException {
+ setNClob(parameterIndex, x.getCharacterStream(), this.connection
+ .getUseStreamLengthsInPrepStmts() ? x.length() : -1);
+ }
+
+ /**
* JDBC 4.0 Set a NCLOB parameter.
*
* @param parameterIndex
@@ -99,42 +101,51 @@
public void setNClob(int parameterIndex, Reader reader, long length)
throws SQLException {
// can't take if characterEncoding isn't utf8
- if (!this.charEncoding.equalsIgnoreCase("UTF-8")
- && !this.charEncoding.equalsIgnoreCase("utf8")) {
- throw SQLError.createSQLException(
- "Can not call setNClob() when connection character set isn't UTF-8");
- }
-
- checkClosed();
-
- if (reader == null) {
- setNull(parameterIndex, java.sql.Types.NCLOB);
- } else {
- BindValue binding = getBinding(parameterIndex, true);
- setType(binding, MysqlDefs.FIELD_TYPE_BLOB);
+ if (!this.charEncoding.equalsIgnoreCase("UTF-8")
+ && !this.charEncoding.equalsIgnoreCase("utf8")) {
+ throw SQLError
+ .createSQLException("Can not call setNClob() when connection character set isn't
UTF-8");
+ }
- binding.value = reader;
- binding.isNull = false;
- binding.isLongData = true;
+ checkClosed();
- if (this.connection.getUseStreamLengthsInPrepStmts()) {
- binding.bindLength = length;
- } else {
- binding.bindLength = -1;
- }
- }
+ if (reader == null) {
+ setNull(parameterIndex, java.sql.Types.NCLOB);
+ } else {
+ BindValue binding = getBinding(parameterIndex, true);
+ setType(binding, MysqlDefs.FIELD_TYPE_BLOB);
+
+ binding.value = reader;
+ binding.isNull = false;
+ binding.isLongData = true;
+
+ if (this.connection.getUseStreamLengthsInPrepStmts()) {
+ binding.bindLength = length;
+ } else {
+ binding.bindLength = -1;
+ }
+ }
}
/**
* @see java.sql.PreparedStatement#setNString(int, java.lang.String)
*/
public void setNString(int parameterIndex, String x) throws SQLException {
- if (this.charEncoding.equalsIgnoreCase("UTF-8")
- || this.charEncoding.equalsIgnoreCase("utf8")) {
- setString(parameterIndex, x);
- } else {
- throw SQLError.createSQLException(
- "Can not call setNString() when connection character set isn't UTF-8");
- }
+ if (this.charEncoding.equalsIgnoreCase("UTF-8")
+ || this.charEncoding.equalsIgnoreCase("utf8")) {
+ setString(parameterIndex, x);
+ } else {
+ throw SQLError
+ .createSQLException("Can not call setNString() when connection character set isn't
UTF-8");
+ }
}
+
+ public void setRowId(int parameterIndex, RowId x) throws SQLException {
+ JDBC4PreparedStatementHelper.setRowId(this, parameterIndex, x);
+ }
+
+ public void setSQLXML(int parameterIndex, SQLXML xmlObject)
+ throws SQLException {
+ JDBC4PreparedStatementHelper.setSQLXML(this, parameterIndex, xmlObject);
+ }
}
Modified: trunk/connector-j/src/com/mysql/jdbc/MysqlIO.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/MysqlIO.java 2007-10-04 19:50:37 UTC (rev 6615)
+++ trunk/connector-j/src/com/mysql/jdbc/MysqlIO.java 2007-10-04 19:57:22 UTC (rev 6616)
@@ -968,7 +968,7 @@
java.sql.ResultSet rs = null;
try {
- stmt = this.connection.clientPrepareStatement("EXPLAIN ?"); //$NON-NLS-1$
+ stmt = (PreparedStatement)
this.connection.clientPrepareStatement("EXPLAIN ?"); //$NON-NLS-1$
stmt.setBytesNoEscapeNoQuotes(1, querySQL);
rs = stmt.executeQuery();
Modified: trunk/connector-j/src/com/mysql/jdbc/UpdatableResultSet.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/UpdatableResultSet.java 2007-10-04 19:50:37 UTC
(rev 6615)
+++ trunk/connector-j/src/com/mysql/jdbc/UpdatableResultSet.java 2007-10-04 19:57:22 UTC
(rev 6616)
@@ -465,7 +465,7 @@
generateStatements();
}
- this.deleter = this.connection
+ this.deleter = (PreparedStatement) this.connection
.clientPrepareStatement(this.deleteSQL);
}
@@ -1026,7 +1026,7 @@
generateStatements();
}
- this.inserter = this.connection
+ this.inserter = (PreparedStatement) this.connection
.clientPrepareStatement(this.insertSQL);
if (this.populateInserterWithDefaultValues) {
extractDefaultValues();
@@ -1280,7 +1280,7 @@
generateStatements();
}
- this.refresher = this.connection
+ this.refresher = (PreparedStatement) this.connection
.clientPrepareStatement(this.refreshSQL);
}
@@ -1492,7 +1492,7 @@
generateStatements();
}
- this.updater = this.connection
+ this.updater = (PreparedStatement) this.connection
.clientPrepareStatement(this.updateSQL);
}
Modified:
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/CallableStatementWrapper.java
===================================================================
---
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/CallableStatementWrapper.java 2007-10-04
19:50:37 UTC (rev 6615)
+++
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/CallableStatementWrapper.java 2007-10-04
19:57:22 UTC (rev 6616)
@@ -26,6 +26,7 @@
import java.io.InputStream;
import java.io.Reader;
+import java.lang.reflect.Constructor;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
@@ -33,6 +34,7 @@
import java.sql.CallableStatement;
import java.sql.Clob;
import java.sql.Date;
+import java.sql.PreparedStatement;
//import java.sql.NClob;
import java.sql.Ref;
//import java.sql.RowId;
@@ -44,6 +46,7 @@
import java.util.Map;
import com.mysql.jdbc.SQLError;
+import com.mysql.jdbc.Util;
import com.mysql.jdbc.exceptions.NotYetImplementedException;
/**
@@ -55,6 +58,42 @@
public class CallableStatementWrapper extends PreparedStatementWrapper
implements CallableStatement {
+private static final Constructor JDBC_4_CALLABLE_STATEMENT_WRAPPER_CTOR;
+
+ static {
+ if (Util.isJdbc4()) {
+ try {
+ JDBC_4_CALLABLE_STATEMENT_WRAPPER_CTOR = Class.forName(
+ "com.mysql.jdbc.jdbc2.optional.JDBC4CallableStatementWrapper").getConstructor(
+ new Class[] { ConnectionWrapper.class,
+ MysqlPooledConnection.class,
+ CallableStatement.class });
+ } catch (SecurityException e) {
+ throw new RuntimeException(e);
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ JDBC_4_CALLABLE_STATEMENT_WRAPPER_CTOR = null;
+ }
+ }
+
+ protected static CallableStatementWrapper getInstance(ConnectionWrapper c,
+ MysqlPooledConnection conn,
+ CallableStatement toWrap) throws SQLException {
+ if (!Util.isJdbc4()) {
+ return new CallableStatementWrapper(c,
+ conn, toWrap);
+ }
+
+ return (CallableStatementWrapper) Util.handleNewInstance(
+ JDBC_4_CALLABLE_STATEMENT_WRAPPER_CTOR,
+ new Object[] {c,
+ conn, toWrap });
+ }
+
/**
* @param c
* @param conn
Modified: trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java 2007-10-04
19:50:37 UTC (rev 6615)
+++ trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java 2007-10-04
19:57:22 UTC (rev 6616)
@@ -29,11 +29,15 @@
import java.sql.SQLException;
import java.sql.Savepoint;
import java.sql.Statement;
+import java.util.TimeZone;
import com.mysql.jdbc.ConnectionImpl;
import com.mysql.jdbc.MysqlErrorNumbers;
+import com.mysql.jdbc.PreparedStatement;
import com.mysql.jdbc.SQLError;
+import com.mysql.jdbc.ServerPreparedStatement;
import com.mysql.jdbc.Util;
+import com.mysql.jdbc.log.Log;
/**
* This class serves as a wrapper for the org.gjt.mm.mysql.jdbc2.Connection
@@ -57,7 +61,8 @@
* @see org.gjt.mm.mysql.jdbc2.Connection
* @see org.gjt.mm.mysql.jdbc2.optional.MysqlPooledConnection
*/
-public class ConnectionWrapper extends WrapperBase implements Connection {
+public class ConnectionWrapper extends WrapperBase implements Connection,
+ com.mysql.jdbc.Connection {
protected com.mysql.jdbc.ConnectionImpl mc = null;
private MysqlPooledConnection mpc = null;
@@ -65,18 +70,19 @@
private String invalidHandleStr = "Logical handle no longer valid";
private boolean closed;
+
private boolean isForXa;
-
+
private static final Constructor JDBC_4_CONNECTION_WRAPPER_CTOR;
-
+
static {
if (Util.isJdbc4()) {
try {
JDBC_4_CONNECTION_WRAPPER_CTOR = Class.forName(
- "com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper").getConstructor(
- new Class[] { MysqlPooledConnection.class,
- ConnectionImpl.class,
- Boolean.TYPE });
+ "com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper")
+ .getConstructor(
+ new Class[] { MysqlPooledConnection.class,
+ ConnectionImpl.class, Boolean.TYPE });
} catch (SecurityException e) {
throw new RuntimeException(e);
} catch (NoSuchMethodException e) {
@@ -88,23 +94,21 @@
JDBC_4_CONNECTION_WRAPPER_CTOR = null;
}
}
-
+
protected static ConnectionWrapper getInstance(
MysqlPooledConnection mysqlPooledConnection,
- ConnectionImpl mysqlConnection,
- boolean forXa
- ) throws SQLException {
+ ConnectionImpl mysqlConnection, boolean forXa) throws SQLException {
if (!Util.isJdbc4()) {
- return new ConnectionWrapper(mysqlPooledConnection,
+ return new ConnectionWrapper(mysqlPooledConnection,
mysqlConnection, forXa);
}
return (ConnectionWrapper) Util.handleNewInstance(
- JDBC_4_CONNECTION_WRAPPER_CTOR,
- new Object[] { mysqlPooledConnection,
- mysqlConnection, Boolean.valueOf(forXa) });
+ JDBC_4_CONNECTION_WRAPPER_CTOR, new Object[] {
+ mysqlPooledConnection, mysqlConnection,
+ Boolean.valueOf(forXa) });
}
-
+
/**
* Construct a new LogicalHandle and set instance variables
*
@@ -117,14 +121,13 @@
* if an error occurs.
*/
public ConnectionWrapper(MysqlPooledConnection mysqlPooledConnection,
- ConnectionImpl mysqlConnection,
- boolean forXa) throws SQLException {
+ ConnectionImpl mysqlConnection, boolean forXa) throws SQLException {
this.mpc = mysqlPooledConnection;
this.mc = mysqlConnection;
this.closed = false;
this.pooledConnection = this.mpc;
this.isForXa = forXa;
-
+
if (this.isForXa) {
setInGlobalTx(false);
}
@@ -140,11 +143,12 @@
checkClosed();
if (autoCommit && isInGlobalTx()) {
- throw SQLError.createSQLException("Can't set autocommit to 'true' on an XAConnection",
- SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
+ throw SQLError.createSQLException(
+ "Can't set autocommit to 'true' on an XAConnection",
+ SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
MysqlErrorNumbers.ER_XA_RMERR);
}
-
+
try {
this.mc.setAutoCommit(autoCommit);
} catch (SQLException sqlException) {
@@ -217,7 +221,7 @@
return (this.closed || this.mc.isClosed());
}
- public boolean isMasterConnection() throws SQLException {
+ public boolean isMasterConnection() {
return this.mc.isMasterConnection();
}
@@ -247,7 +251,7 @@
}
return Statement.CLOSE_CURRENT_RESULT; // we don't reach this code,
- // compiler can't tell
+ // compiler can't tell
}
/**
@@ -321,11 +325,12 @@
checkClosed();
if (isInGlobalTx()) {
- throw SQLError.createSQLException("Can't set autocommit to 'true' on an XAConnection",
- SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
+ throw SQLError.createSQLException(
+ "Can't set autocommit to 'true' on an XAConnection",
+ SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
MysqlErrorNumbers.ER_XA_RMERR);
}
-
+
try {
return this.mc.setSavepoint();
} catch (SQLException sqlException) {
@@ -342,11 +347,12 @@
checkClosed();
if (isInGlobalTx()) {
- throw SQLError.createSQLException("Can't set autocommit to 'true' on an XAConnection",
- SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
+ throw SQLError.createSQLException(
+ "Can't set autocommit to 'true' on an XAConnection",
+ SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
MysqlErrorNumbers.ER_XA_RMERR);
}
-
+
try {
return this.mc.setSavepoint(arg0);
} catch (SQLException sqlException) {
@@ -388,7 +394,7 @@
}
return TRANSACTION_REPEATABLE_READ; // we don't reach this code,
- // compiler can't tell
+ // compiler can't tell
}
/**
@@ -483,12 +489,13 @@
*/
public void commit() throws SQLException {
checkClosed();
-
+
if (isInGlobalTx()) {
- throw SQLError.createSQLException(
- "Can't call commit() on an XAConnection associated with a global transaction",
- SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
- MysqlErrorNumbers.ER_XA_RMERR);
+ throw SQLError
+ .createSQLException(
+ "Can't call commit() on an XAConnection associated with a global transaction",
+ SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
+ MysqlErrorNumbers.ER_XA_RMERR);
}
try {
@@ -508,7 +515,7 @@
checkClosed();
try {
- return new StatementWrapper(this, this.mpc, this.mc
+ return StatementWrapper.getInstance(this, this.mpc, this.mc
.createStatement());
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -528,7 +535,7 @@
checkClosed();
try {
- return new StatementWrapper(this, this.mpc, this.mc
+ return StatementWrapper.getInstance(this, this.mpc, this.mc
.createStatement(resultSetType, resultSetConcurrency));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -545,7 +552,7 @@
checkClosed();
try {
- return new StatementWrapper(this, this.mpc, this.mc
+ return StatementWrapper.getInstance(this, this.mpc, this.mc
.createStatement(arg0, arg1, arg2));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -583,7 +590,7 @@
checkClosed();
try {
- return new CallableStatementWrapper(this, this.mpc, this.mc
+ return CallableStatementWrapper.getInstance(this, this.mpc, this.mc
.prepareCall(sql));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -603,7 +610,7 @@
checkClosed();
try {
- return new CallableStatementWrapper(this, this.mpc, this.mc
+ return CallableStatementWrapper.getInstance(this, this.mpc, this.mc
.prepareCall(sql, resultSetType, resultSetConcurrency));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -620,7 +627,7 @@
checkClosed();
try {
- return new CallableStatementWrapper(this, this.mpc, this.mc
+ return CallableStatementWrapper.getInstance(this, this.mpc, this.mc
.prepareCall(arg0, arg1, arg2, arg3));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -629,36 +636,35 @@
return null; // we don't reach this code, compiler can't tell
}
- public java.sql.PreparedStatement clientPrepare(String sql) throws SQLException
- {
+ public java.sql.PreparedStatement clientPrepare(String sql)
+ throws SQLException {
checkClosed();
try {
- return new PreparedStatementWrapper(this, this.mpc,
- this.mc.clientPrepareStatement(sql));
+ return new PreparedStatementWrapper(this, this.mpc, this.mc
+ .clientPrepareStatement(sql));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
}
-
+
return null;
}
-
+
public java.sql.PreparedStatement clientPrepare(String sql,
- int resultSetType, int resultSetConcurrency) throws SQLException
- {
+ int resultSetType, int resultSetConcurrency) throws SQLException {
checkClosed();
try {
- return new PreparedStatementWrapper(this, this.mpc,
- this.mc.clientPrepareStatement(sql,
- resultSetType, resultSetConcurrency));
+ return new PreparedStatementWrapper(this, this.mpc, this.mc
+ .clientPrepareStatement(sql, resultSetType,
+ resultSetConcurrency));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
}
-
+
return null;
}
-
+
/**
* Passes call to method on physical connection instance. Notifies listeners
* of any caught exceptions before re-throwing to client.
@@ -670,7 +676,7 @@
checkClosed();
try {
- return new PreparedStatementWrapper(this, this.mpc, this.mc
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
.prepareStatement(sql));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -690,8 +696,9 @@
checkClosed();
try {
- return new PreparedStatementWrapper(this, this.mpc, this.mc
- .prepareStatement(sql, resultSetType, resultSetConcurrency));
+ return PreparedStatementWrapper
+ .getInstance(this, this.mpc, this.mc.prepareStatement(sql,
+ resultSetType, resultSetConcurrency));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
}
@@ -707,7 +714,7 @@
checkClosed();
try {
- return new PreparedStatementWrapper(this, this.mpc, this.mc
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
.prepareStatement(arg0, arg1, arg2, arg3));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -724,7 +731,7 @@
checkClosed();
try {
- return new PreparedStatementWrapper(this, this.mpc, this.mc
+ PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
.prepareStatement(arg0, arg1));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -741,7 +748,7 @@
checkClosed();
try {
- return new PreparedStatementWrapper(this, this.mpc, this.mc
+ PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
.prepareStatement(arg0, arg1));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -758,7 +765,7 @@
checkClosed();
try {
- return new PreparedStatementWrapper(this, this.mpc, this.mc
+ PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
.prepareStatement(arg0, arg1));
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
@@ -789,13 +796,14 @@
public void rollback() throws SQLException {
checkClosed();
-
if (isInGlobalTx()) {
- throw SQLError.createSQLException("Can't call rollback() on an XAConnection associated
with a global transaction",
- SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
- MysqlErrorNumbers.ER_XA_RMERR);
+ throw SQLError
+ .createSQLException(
+ "Can't call rollback() on an XAConnection associated with a global transaction",
+ SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
+ MysqlErrorNumbers.ER_XA_RMERR);
}
-
+
try {
this.mc.rollback();
} catch (SQLException sqlException) {
@@ -810,11 +818,13 @@
checkClosed();
if (isInGlobalTx()) {
- throw SQLError.createSQLException("Can't call rollback() on an XAConnection associated
with a global transaction",
- SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
- MysqlErrorNumbers.ER_XA_RMERR);
+ throw SQLError
+ .createSQLException(
+ "Can't call rollback() on an XAConnection associated with a global transaction",
+ SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
+ MysqlErrorNumbers.ER_XA_RMERR);
}
-
+
try {
this.mc.rollback(arg0);
} catch (SQLException sqlException) {
@@ -824,22 +834,21 @@
public boolean isSameResource(Connection c) {
if (c instanceof ConnectionWrapper) {
- return this.mc.isSameResource(((ConnectionWrapper)c).mc);
+ return this.mc.isSameResource(((ConnectionWrapper) c).mc);
} else if (c instanceof com.mysql.jdbc.Connection) {
- return this.mc.isSameResource((com.mysql.jdbc.Connection)c);
+ return this.mc.isSameResource((com.mysql.jdbc.Connection) c);
}
-
+
return false;
}
-
+
protected void close(boolean fireClosedEvent) throws SQLException {
synchronized (this.mpc) {
if (this.closed) {
return;
}
- if (!isInGlobalTx()
- && this.mc.getRollbackOnPooledClose()
+ if (!isInGlobalTx() && this.mc.getRollbackOnPooledClose()
&& !this.getAutoCommit()) {
rollback();
}
@@ -864,17 +873,1628 @@
}
}
- protected boolean isInGlobalTx() {
+ public boolean isInGlobalTx() {
return this.mc.isInGlobalTx();
}
protected void setInGlobalTx(boolean flag) {
this.mc.setInGlobalTx(flag);
}
-
+
public void ping() throws SQLException {
if (this.mc != null) {
this.mc.ping();
}
}
+
+ public void changeUser(String userName, String newPassword)
+ throws SQLException {
+ checkClosed();
+
+ try {
+ this.mc.changeUser(userName, newPassword);
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+ }
+
+ public void clearHasTriedMaster() {
+ this.mc.clearHasTriedMaster();
+ }
+
+ public java.sql.PreparedStatement clientPrepareStatement(String sql)
+ throws SQLException {
+ checkClosed();
+
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .clientPrepareStatement(sql));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public java.sql.PreparedStatement clientPrepareStatement(String sql,
+ int autoGenKeyIndex) throws SQLException {
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .clientPrepareStatement(sql, autoGenKeyIndex));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public java.sql.PreparedStatement clientPrepareStatement(String sql,
+ int resultSetType, int resultSetConcurrency) throws SQLException {
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .clientPrepareStatement(sql, resultSetType,
+ resultSetConcurrency));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public java.sql.PreparedStatement clientPrepareStatement(String sql,
+ int resultSetType, int resultSetConcurrency,
+ int resultSetHoldability) throws SQLException {
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .clientPrepareStatement(sql, resultSetType,
+ resultSetConcurrency, resultSetHoldability));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public java.sql.PreparedStatement clientPrepareStatement(String sql,
+ int[] autoGenKeyIndexes) throws SQLException {
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .clientPrepareStatement(sql, autoGenKeyIndexes));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public java.sql.PreparedStatement clientPrepareStatement(String sql,
+ String[] autoGenKeyColNames) throws SQLException {
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .clientPrepareStatement(sql, autoGenKeyColNames));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public int getActiveStatementCount() {
+ return this.mc.getActiveStatementCount();
+ }
+
+ public Log getLog() throws SQLException {
+ return this.mc.getLog();
+ }
+
+ public String getServerCharacterEncoding() {
+ return this.mc.getServerCharacterEncoding();
+ }
+
+ public TimeZone getServerTimezoneTZ() {
+ return this.mc.getServerTimezoneTZ();
+ }
+
+ public String getStatementComment() {
+ return this.mc.getStatementComment();
+ }
+
+ public boolean hasTriedMaster() {
+ return this.mc.hasTriedMaster();
+ }
+
+ public boolean isAbonormallyLongQuery(long millisOrNanos) {
+ return this.mc.isAbonormallyLongQuery(millisOrNanos);
+ }
+
+ public boolean isNoBackslashEscapesSet() {
+ return this.mc.isNoBackslashEscapesSet();
+ }
+
+ public boolean lowerCaseTableNames() {
+ return this.mc.lowerCaseTableNames();
+ }
+
+ public boolean parserKnowsUnicode() {
+ return this.mc.parserKnowsUnicode();
+ }
+
+ public void reportQueryTime(long millisOrNanos) {
+ this.mc.reportQueryTime(millisOrNanos);
+ }
+
+ public void resetServerState() throws SQLException {
+ checkClosed();
+
+ try {
+ this.mc.resetServerState();
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+ }
+
+ public java.sql.PreparedStatement serverPrepareStatement(String sql)
+ throws SQLException {
+ checkClosed();
+
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .serverPrepareStatement(sql));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public java.sql.PreparedStatement serverPrepareStatement(String sql,
+ int autoGenKeyIndex) throws SQLException {
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .serverPrepareStatement(sql, autoGenKeyIndex));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public java.sql.PreparedStatement serverPrepareStatement(String sql,
+ int resultSetType, int resultSetConcurrency) throws SQLException {
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .serverPrepareStatement(sql, resultSetType,
+ resultSetConcurrency));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public java.sql.PreparedStatement serverPrepareStatement(String sql,
+ int resultSetType, int resultSetConcurrency,
+ int resultSetHoldability) throws SQLException {
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .serverPrepareStatement(sql, resultSetType,
+ resultSetConcurrency, resultSetHoldability));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public java.sql.PreparedStatement serverPrepareStatement(String sql,
+ int[] autoGenKeyIndexes) throws SQLException {
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .serverPrepareStatement(sql, autoGenKeyIndexes));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public java.sql.PreparedStatement serverPrepareStatement(String sql,
+ String[] autoGenKeyColNames) throws SQLException {
+ try {
+ return PreparedStatementWrapper.getInstance(this, this.mpc, this.mc
+ .serverPrepareStatement(sql, autoGenKeyColNames));
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public void setFailedOver(boolean flag) {
+ this.mc.setFailedOver(flag);
+
+ }
+
+ public void setPreferSlaveDuringFailover(boolean flag) {
+ this.mc.setPreferSlaveDuringFailover(flag);
+ }
+
+ public void setStatementComment(String comment) {
+ this.mc.setStatementComment(comment);
+
+ }
+
+ public void shutdownServer() throws SQLException {
+ checkClosed();
+
+ try {
+ this.mc.shutdownServer();
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ }
+
+ public boolean supportsIsolationLevel() {
+ return this.mc.supportsIsolationLevel();
+ }
+
+ public boolean supportsQuotedIdentifiers() {
+ return this.mc.supportsQuotedIdentifiers();
+ }
+
+ public boolean supportsTransactions() {
+ return this.mc.supportsTransactions();
+ }
+
+ public boolean versionMeetsMinimum(int major, int minor, int subminor)
+ throws SQLException {
+ checkClosed();
+
+ try {
+ return this.mc.versionMeetsMinimum(major, minor, subminor);
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return false;
+ }
+
+ public String exposeAsXml() throws SQLException {
+ checkClosed();
+
+ try {
+ return this.mc.exposeAsXml();
+ } catch (SQLException sqlException) {
+ checkAndFireConnectionError(sqlException);
+ }
+
+ return null;
+ }
+
+ public boolean getAllowLoadLocalInfile() {
+ return this.mc.getAllowLoadLocalInfile();
+ }
+
+ public boolean getAllowMultiQueries() {
+ return this.mc.getAllowMultiQueries();
+ }
+
+ public boolean getAllowNanAndInf() {
+ return this.mc.getAllowNanAndInf();
+ }
+
+ public boolean getAllowUrlInLocalInfile() {
+ return this.mc.getAllowUrlInLocalInfile();
+ }
+
+ public boolean getAlwaysSendSetIsolation() {
+ return this.mc.getAlwaysSendSetIsolation();
+ }
+
+ public boolean getAutoClosePStmtStreams() {
+ return this.mc.getAutoClosePStmtStreams();
+ }
+
+ public boolean getAutoDeserialize() {
+ return this.mc.getAutoDeserialize();
+ }
+
+ public boolean getAutoGenerateTestcaseScript() {
+ return this.mc.getAutoGenerateTestcaseScript();
+ }
+
+ public boolean getAutoReconnectForPools() {
+ return this.mc.getAutoReconnectForPools();
+ }
+
+ public boolean getAutoSlowLog() {
+ return this.mc.getAutoSlowLog();
+ }
+
+ public int getBlobSendChunkSize() {
+ return this.mc.getBlobSendChunkSize();
+ }
+
+ public boolean getBlobsAreStrings() {
+ return this.mc.getBlobsAreStrings();
+ }
+
+ public boolean getCacheCallableStatements() {
+ return this.mc.getCacheCallableStatements();
+ }
+
+ public boolean getCacheCallableStmts() {
+ return this.mc.getCacheCallableStmts();
+ }
+
+ public boolean getCachePrepStmts() {
+ return this.mc.getCachePrepStmts();
+ }
+
+ public boolean getCachePreparedStatements() {
+ return this.mc.getCachePreparedStatements();
+ }
+
+ public boolean getCacheResultSetMetadata() {
+ return this.mc.getCacheResultSetMetadata();
+ }
+
+ public boolean getCacheServerConfiguration() {
+ return this.mc.getCacheServerConfiguration();
+ }
+
+ public int getCallableStatementCacheSize() {
+ return this.mc.getCallableStatementCacheSize();
+ }
+
+ public int getCallableStmtCacheSize() {
+ return this.mc.getCallableStmtCacheSize();
+ }
+
+ public boolean getCapitalizeTypeNames() {
+ return this.mc.getCapitalizeTypeNames();
+ }
+
+ public String getCharacterSetResults() {
+ return this.mc.getCharacterSetResults();
+ }
+
+ public String getClientCertificateKeyStorePassword() {
+ return this.mc.getClientCertificateKeyStorePassword();
+ }
+
+ public String getClientCertificateKeyStoreType() {
+ return this.mc.getClientCertificateKeyStoreType();
+ }
+
+ public String getClientCertificateKeyStoreUrl() {
+ return this.mc.getClientCertificateKeyStoreUrl();
+ }
+
+ public String getClientInfoProvider() {
+ return this.mc.getClientInfoProvider();
+ }
+
+ public String getClobCharacterEncoding() {
+ return this.mc.getClobCharacterEncoding();
+ }
+
+ public boolean getClobberStreamingResults() {
+ return this.mc.getClobberStreamingResults();
+ }
+
+ public int getConnectTimeout() {
+ return this.mc.getConnectTimeout();
+ }
+
+ public String getConnectionCollation() {
+ return this.mc.getConnectionCollation();
+ }
+
+ public String getConnectionLifecycleInterceptors() {
+ return this.mc.getConnectionLifecycleInterceptors();
+ }
+
+ public boolean getContinueBatchOnError() {
+ return this.mc.getContinueBatchOnError();
+ }
+
+ public boolean getCreateDatabaseIfNotExist() {
+ return this.mc.getCreateDatabaseIfNotExist();
+ }
+
+ public int getDefaultFetchSize() {
+ return this.mc.getDefaultFetchSize();
+ }
+
+ public boolean getDontTrackOpenResources() {
+ return this.mc.getDontTrackOpenResources();
+ }
+
+ public boolean getDumpMetadataOnColumnNotFound() {
+ return this.mc.getDumpMetadataOnColumnNotFound();
+ }
+
+ public boolean getDumpQueriesOnException() {
+ return this.mc.getDumpQueriesOnException();
+ }
+
+ public boolean getDynamicCalendars() {
+ return this.mc.getDynamicCalendars();
+ }
+
+ public boolean getElideSetAutoCommits() {
+ return this.mc.getElideSetAutoCommits();
+ }
+
+ public boolean getEmptyStringsConvertToZero() {
+ return this.mc.getEmptyStringsConvertToZero();
+ }
+
+ public boolean getEmulateLocators() {
+ return this.mc.getEmulateLocators();
+ }
+
+ public boolean getEmulateUnsupportedPstmts() {
+ return this.mc.getEmulateUnsupportedPstmts();
+ }
+
+ public boolean getEnablePacketDebug() {
+ return this.mc.getEnablePacketDebug();
+ }
+
+ public boolean getEnableQueryTimeouts() {
+ return this.mc.getEnableQueryTimeouts();
+ }
+
+ public String getEncoding() {
+ return this.mc.getEncoding();
+ }
+
+ public boolean getExplainSlowQueries() {
+ return this.mc.getExplainSlowQueries();
+ }
+
+ public boolean getFailOverReadOnly() {
+ return this.mc.getFailOverReadOnly();
+ }
+
+ public boolean getFunctionsNeverReturnBlobs() {
+ return this.mc.getFunctionsNeverReturnBlobs();
+ }
+
+ public boolean getGatherPerfMetrics() {
+ return this.mc.getGatherPerfMetrics();
+ }
+
+ public boolean getGatherPerformanceMetrics() {
+ return this.mc.getGatherPerformanceMetrics();
+ }
+
+ public boolean getGenerateSimpleParameterMetadata() {
+ return this.mc.getGenerateSimpleParameterMetadata();
+ }
+
+ public boolean getHoldResultsOpenOverStatementClose() {
+ return this.mc.getHoldResultsOpenOverStatementClose();
+ }
+
+ public boolean getIgnoreNonTxTables() {
+ return this.mc.getIgnoreNonTxTables();
+ }
+
+ public boolean getIncludeInnodbStatusInDeadlockExceptions() {
+ return this.mc.getIncludeInnodbStatusInDeadlockExceptions();
+ }
+
+ public int getInitialTimeout() {
+ return this.mc.getInitialTimeout();
+ }
+
+ public boolean getInteractiveClient() {
+ return this.mc.getInteractiveClient();
+ }
+
+ public boolean getIsInteractiveClient() {
+ return this.mc.getIsInteractiveClient();
+ }
+
+ public boolean getJdbcCompliantTruncation() {
+ return this.mc.getJdbcCompliantTruncation();
+ }
+
+ public boolean getJdbcCompliantTruncationForReads() {
+ return this.mc.getJdbcCompliantTruncationForReads();
+ }
+
+ public String getLargeRowSizeThreshold() {
+ return this.mc.getLargeRowSizeThreshold();
+ }
+
+ public String getLoadBalanceStrategy() {
+ return this.mc.getLoadBalanceStrategy();
+ }
+
+ public String getLocalSocketAddress() {
+ return this.mc.getLocalSocketAddress();
+ }
+
+ public int getLocatorFetchBufferSize() {
+ return this.mc.getLocatorFetchBufferSize();
+ }
+
+ public boolean getLogSlowQueries() {
+ return this.mc.getLogSlowQueries();
+ }
+
+ public boolean getLogXaCommands() {
+ return this.mc.getLogXaCommands();
+ }
+
+ public String getLogger() {
+ return this.mc.getLogger();
+ }
+
+ public String getLoggerClassName() {
+ return this.mc.getLoggerClassName();
+ }
+
+ public boolean getMaintainTimeStats() {
+ return this.mc.getMaintainTimeStats();
+ }
+
+ public int getMaxQuerySizeToLog() {
+ return this.mc.getMaxQuerySizeToLog();
+ }
+
+ public int getMaxReconnects() {
+ return this.mc.getMaxReconnects();
+ }
+
+ public int getMaxRows() {
+ return this.mc.getMaxRows();
+ }
+
+ public int getMetadataCacheSize() {
+ return this.mc.getMetadataCacheSize();
+ }
+
+ public int getNetTimeoutForStreamingResults() {
+ return this.mc.getNetTimeoutForStreamingResults();
+ }
+
+ public boolean getNoAccessToProcedureBodies() {
+ return this.mc.getNoAccessToProcedureBodies();
+ }
+
+ public boolean getNoDatetimeStringSync() {
+ return this.mc.getNoDatetimeStringSync();
+ }
+
+ public boolean getNoTimezoneConversionForTimeType() {
+ return this.mc.getNoTimezoneConversionForTimeType();
+ }
+
+ public boolean getNullCatalogMeansCurrent() {
+ return this.mc.getNullCatalogMeansCurrent();
+ }
+
+ public boolean getNullNamePatternMatchesAll() {
+ return this.mc.getNullNamePatternMatchesAll();
+ }
+
+ public boolean getOverrideSupportsIntegrityEnhancementFacility() {
+ return this.mc.getOverrideSupportsIntegrityEnhancementFacility();
+ }
+
+ public int getPacketDebugBufferSize() {
+ return this.mc.getPacketDebugBufferSize();
+ }
+
+ public boolean getPadCharsWithSpace() {
+ return this.mc.getPadCharsWithSpace();
+ }
+
+ public boolean getParanoid() {
+ return this.mc.getParanoid();
+ }
+
+ public boolean getPedantic() {
+ return this.mc.getPedantic();
+ }
+
+ public boolean getPinGlobalTxToPhysicalConnection() {
+ return this.mc.getPinGlobalTxToPhysicalConnection();
+ }
+
+ public boolean getPopulateInsertRowWithDefaultValues() {
+ return this.mc.getPopulateInsertRowWithDefaultValues();
+ }
+
+ public int getPrepStmtCacheSize() {
+ return this.mc.getPrepStmtCacheSize();
+ }
+
+ public int getPrepStmtCacheSqlLimit() {
+ return this.mc.getPrepStmtCacheSqlLimit();
+ }
+
+ public int getPreparedStatementCacheSize() {
+ return this.mc.getPreparedStatementCacheSize();
+ }
+
+ public int getPreparedStatementCacheSqlLimit() {
+ return this.mc.getPreparedStatementCacheSqlLimit();
+ }
+
+ public boolean getProcessEscapeCodesForPrepStmts() {
+ return this.mc.getProcessEscapeCodesForPrepStmts();
+ }
+
+ public boolean getProfileSQL() {
+ return this.mc.getProfileSQL();
+ }
+
+ public boolean getProfileSql() {
+ return this.mc.getProfileSql();
+ }
+
+ public String getPropertiesTransform() {
+ return this.mc.getPropertiesTransform();
+ }
+
+ public int getQueriesBeforeRetryMaster() {
+ return this.mc.getQueriesBeforeRetryMaster();
+ }
+
+ public boolean getReconnectAtTxEnd() {
+ return this.mc.getReconnectAtTxEnd();
+ }
+
+ public boolean getRelaxAutoCommit() {
+ return this.mc.getRelaxAutoCommit();
+ }
+
+ public int getReportMetricsIntervalMillis() {
+ return this.mc.getReportMetricsIntervalMillis();
+ }
+
+ public boolean getRequireSSL() {
+ return this.mc.getRequireSSL();
+ }
+
+ public String getResourceId() {
+ return this.mc.getResourceId();
+ }
+
+ public int getResultSetSizeThreshold() {
+ return this.mc.getResultSetSizeThreshold();
+ }
+
+ public boolean getRewriteBatchedStatements() {
+ return this.mc.getRewriteBatchedStatements();
+ }
+
+ public boolean getRollbackOnPooledClose() {
+ return this.mc.getRollbackOnPooledClose();
+ }
+
+ public boolean getRoundRobinLoadBalance() {
+ return this.mc.getRoundRobinLoadBalance();
+ }
+
+ public boolean getRunningCTS13() {
+ return this.mc.getRunningCTS13();
+ }
+
+ public int getSecondsBeforeRetryMaster() {
+ return this.mc.getSecondsBeforeRetryMaster();
+ }
+
+ public String getServerTimezone() {
+ return this.mc.getServerTimezone();
+ }
+
+ public String getSessionVariables() {
+ return this.mc.getSessionVariables();
+ }
+
+ public int getSlowQueryThresholdMillis() {
+ return this.mc.getSlowQueryThresholdMillis();
+ }
+
+ public long getSlowQueryThresholdNanos() {
+ return this.mc.getSlowQueryThresholdNanos();
+ }
+
+ public String getSocketFactory() {
+ return this.mc.getSocketFactory();
+ }
+
+ public String getSocketFactoryClassName() {
+ return this.mc.getSocketFactoryClassName();
+ }
+
+ public int getSocketTimeout() {
+ return this.mc.getSocketTimeout();
+ }
+
+ public String getStatementInterceptors() {
+ return this.mc.getStatementInterceptors();
+ }
+
+ public boolean getStrictFloatingPoint() {
+ return this.mc.getStrictFloatingPoint();
+ }
+
+ public boolean getStrictUpdates() {
+ return this.mc.getStrictUpdates();
+ }
+
+ public boolean getTcpKeepAlive() {
+ return this.mc.getTcpKeepAlive();
+ }
+
+ public boolean getTcpNoDelay() {
+ return this.mc.getTcpNoDelay();
+ }
+
+ public int getTcpRcvBuf() {
+ return this.mc.getTcpRcvBuf();
+ }
+
+ public int getTcpSndBuf() {
+ return this.mc.getTcpSndBuf();
+ }
+
+ public int getTcpTrafficClass() {
+ return this.mc.getTcpTrafficClass();
+ }
+
+ public boolean getTinyInt1isBit() {
+ return this.mc.getTinyInt1isBit();
+ }
+
+ public boolean getTraceProtocol() {
+ return this.mc.getTraceProtocol();
+ }
+
+ public boolean getTransformedBitIsBoolean() {
+ return this.mc.getTransformedBitIsBoolean();
+ }
+
+ public boolean getTreatUtilDateAsTimestamp() {
+ return this.mc.getTreatUtilDateAsTimestamp();
+ }
+
+ public String getTrustCertificateKeyStorePassword() {
+ return this.mc.getTrustCertificateKeyStorePassword();
+ }
+
+ public String getTrustCertificateKeyStoreType() {
+ return this.mc.getTrustCertificateKeyStoreType();
+ }
+
+ public String getTrustCertificateKeyStoreUrl() {
+ return this.mc.getTrustCertificateKeyStoreUrl();
+ }
+
+ public boolean getUltraDevHack() {
+ return this.mc.getUltraDevHack();
+ }
+
+ public boolean getUseBlobToStoreUTF8OutsideBMP() {
+ return this.mc.getUseBlobToStoreUTF8OutsideBMP();
+ }
+
+ public boolean getUseCompression() {
+ return this.mc.getUseCompression();
+ }
+
+ public String getUseConfigs() {
+ return this.mc.getUseConfigs();
+ }
+
+ public boolean getUseCursorFetch() {
+ return this.mc.getUseCursorFetch();
+ }
+
+ public boolean getUseDirectRowUnpack() {
+ return this.mc.getUseDirectRowUnpack();
+ }
+
+ public boolean getUseDynamicCharsetInfo() {
+ return this.mc.getUseDynamicCharsetInfo();
+ }
+
+ public boolean getUseFastDateParsing() {
+ return this.mc.getUseFastDateParsing();
+ }
+
+ public boolean getUseFastIntParsing() {
+ return this.mc.getUseFastIntParsing();
+ }
+
+ public boolean getUseGmtMillisForDatetimes() {
+ return this.mc.getUseGmtMillisForDatetimes();
+ }
+
+ public boolean getUseHostsInPrivileges() {
+ return this.mc.getUseHostsInPrivileges();
+ }
+
+ public boolean getUseInformationSchema() {
+ return this.mc.getUseInformationSchema();
+ }
+
+ public boolean getUseJDBCCompliantTimezoneShift() {
+ return this.mc.getUseJDBCCompliantTimezoneShift();
+ }
+
+ public boolean getUseJvmCharsetConverters() {
+ return this.mc.getUseJvmCharsetConverters();
+ }
+
+ public boolean getUseLocalSessionState() {
+ return this.mc.getUseLocalSessionState();
+ }
+
+ public boolean getUseNanosForElapsedTime() {
+ return this.mc.getUseNanosForElapsedTime();
+ }
+
+ public boolean getUseOldAliasMetadataBehavior() {
+ return this.mc.getUseOldAliasMetadataBehavior();
+ }
+
+ public boolean getUseOldUTF8Behavior() {
+ return this.mc.getUseOldUTF8Behavior();
+ }
+
+ public boolean getUseOnlyServerErrorMessages() {
+ return this.mc.getUseOnlyServerErrorMessages();
+ }
+
+ public boolean getUseReadAheadInput() {
+ return this.mc.getUseReadAheadInput();
+ }
+
+ public boolean getUseSSL() {
+ return this.mc.getUseSSL();
+ }
+
+ public boolean getUseSSPSCompatibleTimezoneShift() {
+ return this.mc.getUseSSPSCompatibleTimezoneShift();
+ }
+
+ public boolean getUseServerPrepStmts() {
+ return this.mc.getUseServerPrepStmts();
+ }
+
+ public boolean getUseServerPreparedStmts() {
+ return this.mc.getUseServerPreparedStmts();
+ }
+
+ public boolean getUseSqlStateCodes() {
+ return this.mc.getUseSqlStateCodes();
+ }
+
+ public boolean getUseStreamLengthsInPrepStmts() {
+ return this.mc.getUseStreamLengthsInPrepStmts();
+ }
+
+ public boolean getUseTimezone() {
+ return this.mc.getUseTimezone();
+ }
+
+ public boolean getUseUltraDevWorkAround() {
+ return this.mc.getUseUltraDevWorkAround();
+ }
+
+ public boolean getUseUnbufferedInput() {
+ return this.mc.getUseUnbufferedInput();
+ }
+
+ public boolean getUseUnicode() {
+ return this.mc.getUseUnicode();
+ }
+
+ public boolean getUseUsageAdvisor() {
+ return this.mc.getUseUsageAdvisor();
+ }
+
+ public String getUtf8OutsideBmpExcludedColumnNamePattern() {
+ return this.mc.getUtf8OutsideBmpExcludedColumnNamePattern();
+ }
+
+ public String getUtf8OutsideBmpIncludedColumnNamePattern() {
+ return this.mc.getUtf8OutsideBmpIncludedColumnNamePattern();
+ }
+
+ public boolean getYearIsDateType() {
+ return this.mc.getYearIsDateType();
+ }
+
+ public String getZeroDateTimeBehavior() {
+ return this.mc.getZeroDateTimeBehavior();
+ }
+
+ public void setAllowLoadLocalInfile(boolean property) {
+ this.mc.setAllowLoadLocalInfile(property);
+ }
+
+ public void setAllowMultiQueries(boolean property) {
+ this.mc.setAllowMultiQueries(property);
+ }
+
+ public void setAllowNanAndInf(boolean flag) {
+ this.mc.setAllowNanAndInf(flag);
+ }
+
+ public void setAllowUrlInLocalInfile(boolean flag) {
+ this.mc.setAllowUrlInLocalInfile(flag);
+ }
+
+ public void setAlwaysSendSetIsolation(boolean flag) {
+ this.mc.setAlwaysSendSetIsolation(flag);
+ }
+
+ public void setAutoClosePStmtStreams(boolean flag) {
+ this.mc.setAutoClosePStmtStreams(flag);
+ }
+
+ public void setAutoDeserialize(boolean flag) {
+ this.mc.setAutoDeserialize(flag);
+ }
+
+ public void setAutoGenerateTestcaseScript(boolean flag) {
+ this.mc.setAutoGenerateTestcaseScript(flag);
+ }
+
+ public void setAutoReconnect(boolean flag) {
+ this.mc.setAutoReconnect(flag);
+ }
+
+ public void setAutoReconnectForConnectionPools(boolean property) {
+ this.mc.setAutoReconnectForConnectionPools(property);
+ }
+
+ public void setAutoReconnectForPools(boolean flag) {
+ this.mc.setAutoReconnectForPools(flag);
+ }
+
+ public void setAutoSlowLog(boolean flag) {
+ this.mc.setAutoSlowLog(flag);
+ }
+
+ public void setBlobSendChunkSize(String value) throws SQLException {
+ this.mc.setBlobSendChunkSize(value);
+ }
+
+ public void setBlobsAreStrings(boolean flag) {
+ this.mc.setBlobsAreStrings(flag);
+ }
+
+ public void setCacheCallableStatements(boolean flag) {
+ this.mc.setCacheCallableStatements(flag);
+ }
+
+ public void setCacheCallableStmts(boolean flag) {
+ this.mc.setCacheCallableStmts(flag);
+ }
+
+ public void setCachePrepStmts(boolean flag) {
+ this.mc.setCachePrepStmts(flag);
+ }
+
+ public void setCachePreparedStatements(boolean flag) {
+ this.mc.setCachePreparedStatements(flag);
+ }
+
+ public void setCacheResultSetMetadata(boolean property) {
+ this.mc.setCacheResultSetMetadata(property);
+ }
+
+ public void setCacheServerConfiguration(boolean flag) {
+ this.mc.setCacheServerConfiguration(flag);
+ }
+
+ public void setCallableStatementCacheSize(int size) {
+ this.mc.setCallableStatementCacheSize(size);
+ }
+
+ public void setCallableStmtCacheSize(int cacheSize) {
+ this.mc.setCallableStmtCacheSize(cacheSize);
+ }
+
+ public void setCapitalizeDBMDTypes(boolean property) {
+ this.mc.setCapitalizeDBMDTypes(property);
+ }
+
+ public void setCapitalizeTypeNames(boolean flag) {
+ this.mc.setCapitalizeTypeNames(flag);
+ }
+
+ public void setCharacterEncoding(String encoding) {
+ this.mc.setCharacterEncoding(encoding);
+ }
+
+ public void setCharacterSetResults(String characterSet) {
+ this.mc.setCharacterSetResults(characterSet);
+ }
+
+ public void setClientCertificateKeyStorePassword(String value) {
+ this.mc.setClientCertificateKeyStorePassword(value);
+ }
+
+ public void setClientCertificateKeyStoreType(String value) {
+ this.mc.setClientCertificateKeyStoreType(value);
+ }
+
+ public void setClientCertificateKeyStoreUrl(String value) {
+ this.mc.setClientCertificateKeyStoreUrl(value);
+ }
+
+ public void setClientInfoProvider(String classname) {
+ this.mc.setClientInfoProvider(classname);
+ }
+
+ public void setClobCharacterEncoding(String encoding) {
+ this.mc.setClobCharacterEncoding(encoding);
+ }
+
+ public void setClobberStreamingResults(boolean flag) {
+ this.mc.setClobberStreamingResults(flag);
+ }
+
+ public void setConnectTimeout(int timeoutMs) {
+ this.mc.setConnectTimeout(timeoutMs);
+ }
+
+ public void setConnectionCollation(String collation) {
+ this.mc.setConnectionCollation(collation);
+ }
+
+ public void setConnectionLifecycleInterceptors(String interceptors) {
+ this.mc.setConnectionLifecycleInterceptors(interceptors);
+ }
+
+ public void setContinueBatchOnError(boolean property) {
+ this.mc.setContinueBatchOnError(property);
+ }
+
+ public void setCreateDatabaseIfNotExist(boolean flag) {
+ this.mc.setCreateDatabaseIfNotExist(flag);
+ }
+
+ public void setDefaultFetchSize(int n) {
+ this.mc.setDefaultFetchSize(n);
+ }
+
+ public void setDetectServerPreparedStmts(boolean property) {
+ this.mc.setDetectServerPreparedStmts(property);
+ }
+
+ public void setDontTrackOpenResources(boolean flag) {
+ this.mc.setDontTrackOpenResources(flag);
+ }
+
+ public void setDumpMetadataOnColumnNotFound(boolean flag) {
+ this.mc.setDumpMetadataOnColumnNotFound(flag);
+ }
+
+ public void setDumpQueriesOnException(boolean flag) {
+ this.mc.setDumpQueriesOnException(flag);
+ }
+
+ public void setDynamicCalendars(boolean flag) {
+ this.mc.setDynamicCalendars(flag);
+ }
+
+ public void setElideSetAutoCommits(boolean flag) {
+ this.mc.setElideSetAutoCommits(flag);
+ }
+
+ public void setEmptyStringsConvertToZero(boolean flag) {
+ this.mc.setEmptyStringsConvertToZero(flag);
+ }
+
+ public void setEmulateLocators(boolean property) {
+ this.mc.setEmulateLocators(property);
+ }
+
+ public void setEmulateUnsupportedPstmts(boolean flag) {
+ this.mc.setEmulateUnsupportedPstmts(flag);
+ }
+
+ public void setEnablePacketDebug(boolean flag) {
+ this.mc.setEnablePacketDebug(flag);
+ }
+
+ public void setEnableQueryTimeouts(boolean flag) {
+ this.mc.setEnableQueryTimeouts(flag);
+ }
+
+ public void setEncoding(String property) {
+ this.mc.setEncoding(property);
+ }
+
+ public void setExplainSlowQueries(boolean flag) {
+ this.mc.setExplainSlowQueries(flag);
+ }
+
+ public void setFailOverReadOnly(boolean flag) {
+ this.mc.setFailOverReadOnly(flag);
+ }
+
+ public void setFunctionsNeverReturnBlobs(boolean flag) {
+ this.mc.setFunctionsNeverReturnBlobs(flag);
+ }
+
+ public void setGatherPerfMetrics(boolean flag) {
+ this.mc.setGatherPerfMetrics(flag);
+ }
+
+ public void setGatherPerformanceMetrics(boolean flag) {
+ this.mc.setGatherPerformanceMetrics(flag);
+ }
+
+ public void setGenerateSimpleParameterMetadata(boolean flag) {
+ this.mc.setGenerateSimpleParameterMetadata(flag);
+ }
+
+ public void setHoldResultsOpenOverStatementClose(boolean flag) {
+ this.mc.setHoldResultsOpenOverStatementClose(flag);
+ }
+
+ public void setIgnoreNonTxTables(boolean property) {
+ this.mc.setIgnoreNonTxTables(property);
+ }
+
+ public void setIncludeInnodbStatusInDeadlockExceptions(boolean flag) {
+ this.mc.setIncludeInnodbStatusInDeadlockExceptions(flag);
+ }
+
+ public void setInitialTimeout(int property) {
+ this.mc.setInitialTimeout(property);
+ }
+
+ public void setInteractiveClient(boolean property) {
+ this.mc.setInteractiveClient(property);
+ }
+
+ public void setIsInteractiveClient(boolean property) {
+ this.mc.setIsInteractiveClient(property);
+ }
+
+ public void setJdbcCompliantTruncation(boolean flag) {
+ this.mc.setJdbcCompliantTruncation(flag);
+ }
+
+ public void setJdbcCompliantTruncationForReads(
+ boolean jdbcCompliantTruncationForReads) {
+ this.mc
+ .setJdbcCompliantTruncationForReads(jdbcCompliantTruncationForReads);
+ }
+
+ public void setLargeRowSizeThreshold(String value) {
+ this.mc.setLargeRowSizeThreshold(value);
+ }
+
+ public void setLoadBalanceStrategy(String strategy) {
+ this.mc.setLoadBalanceStrategy(strategy);
+ }
+
+ public void setLocalSocketAddress(String address) {
+ this.mc.setLocalSocketAddress(address);
+ }
+
+ public void setLocatorFetchBufferSize(String value) throws SQLException {
+ this.mc.setLocatorFetchBufferSize(value);
+ }
+
+ public void setLogSlowQueries(boolean flag) {
+ this.mc.setLogSlowQueries(flag);
+ }
+
+ public void setLogXaCommands(boolean flag) {
+ this.mc.setLogXaCommands(flag);
+ }
+
+ public void setLogger(String property) {
+ this.mc.setLogger(property);
+ }
+
+ public void setLoggerClassName(String className) {
+ this.mc.setLoggerClassName(className);
+ }
+
+ public void setMaintainTimeStats(boolean flag) {
+ this.mc.setMaintainTimeStats(flag);
+ }
+
+ public void setMaxQuerySizeToLog(int sizeInBytes) {
+ this.mc.setMaxQuerySizeToLog(sizeInBytes);
+ }
+
+ public void setMaxReconnects(int property) {
+ this.mc.setMaxReconnects(property);
+ }
+
+ public void setMaxRows(int property) {
+ this.mc.setMaxRows(property);
+ }
+
+ public void setMetadataCacheSize(int value) {
+ this.mc.setMetadataCacheSize(value);
+ }
+
+ public void setNetTimeoutForStreamingResults(int value) {
+ this.mc.setNetTimeoutForStreamingResults(value);
+ }
+
+ public void setNoAccessToProcedureBodies(boolean flag) {
+ this.mc.setNoAccessToProcedureBodies(flag);
+ }
+
+ public void setNoDatetimeStringSync(boolean flag) {
+ this.mc.setNoDatetimeStringSync(flag);
+ }
+
+ public void setNoTimezoneConversionForTimeType(boolean flag) {
+ this.mc.setNoTimezoneConversionForTimeType(flag);
+ }
+
+ public void setNullCatalogMeansCurrent(boolean value) {
+ this.mc.setNullCatalogMeansCurrent(value);
+ }
+
+ public void setNullNamePatternMatchesAll(boolean value) {
+ this.mc.setNullNamePatternMatchesAll(value);
+ }
+
+ public void setOverrideSupportsIntegrityEnhancementFacility(boolean flag) {
+ this.mc.setOverrideSupportsIntegrityEnhancementFacility(flag);
+ }
+
+ public void setPacketDebugBufferSize(int size) {
+ this.mc.setPacketDebugBufferSize(size);
+ }
+
+ public void setPadCharsWithSpace(boolean flag) {
+ this.mc.setPadCharsWithSpace(flag);
+ }
+
+ public void setParanoid(boolean property) {
+ this.mc.setParanoid(property);
+ }
+
+ public void setPedantic(boolean property) {
+ this.mc.setPedantic(property);
+ }
+
+ public void setPinGlobalTxToPhysicalConnection(boolean flag) {
+ this.mc.setPinGlobalTxToPhysicalConnection(flag);
+ }
+
+ public void setPopulateInsertRowWithDefaultValues(boolean flag) {
+ this.mc.setPopulateInsertRowWithDefaultValues(flag);
+ }
+
+ public void setPrepStmtCacheSize(int cacheSize) {
+ this.mc.setPrepStmtCacheSize(cacheSize);
+ }
+
+ public void setPrepStmtCacheSqlLimit(int sqlLimit) {
+ this.mc.setPrepStmtCacheSqlLimit(sqlLimit);
+ }
+
+ public void setPreparedStatementCacheSize(int cacheSize) {
+ this.mc.setPreparedStatementCacheSize(cacheSize);
+ }
+
+ public void setPreparedStatementCacheSqlLimit(int cacheSqlLimit) {
+ this.mc.setPreparedStatementCacheSqlLimit(cacheSqlLimit);
+ }
+
+ public void setProcessEscapeCodesForPrepStmts(boolean flag) {
+ this.mc.setProcessEscapeCodesForPrepStmts(flag);
+ }
+
+ public void setProfileSQL(boolean flag) {
+ this.mc.setProfileSQL(flag);
+ }
+
+ public void setProfileSql(boolean property) {
+ this.mc.setProfileSql(property);
+ }
+
+ public void setPropertiesTransform(String value) {
+ this.mc.setPropertiesTransform(value);
+ }
+
+ public void setQueriesBeforeRetryMaster(int property) {
+ this.mc.setQueriesBeforeRetryMaster(property);
+ }
+
+ public void setReconnectAtTxEnd(boolean property) {
+ this.mc.setReconnectAtTxEnd(property);
+ }
+
+ public void setRelaxAutoCommit(boolean property) {
+ this.mc.setRelaxAutoCommit(property);
+ }
+
+ public void setReportMetricsIntervalMillis(int millis) {
+ this.mc.setReportMetricsIntervalMillis(millis);
+ }
+
+ public void setRequireSSL(boolean property) {
+ this.mc.setRequireSSL(property);
+ }
+
+ public void setResourceId(String resourceId) {
+ this.mc.setResourceId(resourceId);
+ }
+
+ public void setResultSetSizeThreshold(int threshold) {
+ this.mc.setResultSetSizeThreshold(threshold);
+ }
+
+ public void setRetainStatementAfterResultSetClose(boolean flag) {
+ this.mc.setRetainStatementAfterResultSetClose(flag);
+ }
+
+ public void setRewriteBatchedStatements(boolean flag) {
+ this.mc.setRewriteBatchedStatements(flag);
+ }
+
+ public void setRollbackOnPooledClose(boolean flag) {
+ this.mc.setRollbackOnPooledClose(flag);
+ }
+
+ public void setRoundRobinLoadBalance(boolean flag) {
+ this.mc.setRoundRobinLoadBalance(flag);
+ }
+
+ public void setRunningCTS13(boolean flag) {
+ this.mc.setRunningCTS13(flag);
+ }
+
+ public void setSecondsBeforeRetryMaster(int property) {
+ this.mc.setSecondsBeforeRetryMaster(property);
+ }
+
+ public void setServerTimezone(String property) {
+ this.mc.setServerTimezone(property);
+ }
+
+ public void setSessionVariables(String variables) {
+ this.mc.setSessionVariables(variables);
+ }
+
+ public void setSlowQueryThresholdMillis(int millis) {
+ this.mc.setSlowQueryThresholdMillis(millis);
+ }
+
+ public void setSlowQueryThresholdNanos(long nanos) {
+ this.mc.setSlowQueryThresholdNanos(nanos);
+ }
+
+ public void setSocketFactory(String name) {
+ this.mc.setSocketFactory(name);
+ }
+
+ public void setSocketFactoryClassName(String property) {
+ this.mc.setSocketFactoryClassName(property);
+ }
+
+ public void setSocketTimeout(int property) {
+ this.mc.setSocketTimeout(property);
+ }
+
+ public void setStatementInterceptors(String value) {
+ this.mc.setStatementInterceptors(value);
+ }
+
+ public void setStrictFloatingPoint(boolean property) {
+ this.mc.setStrictFloatingPoint(property);
+ }
+
+ public void setStrictUpdates(boolean property) {
+ this.mc.setStrictUpdates(property);
+ }
+
+ public void setTcpKeepAlive(boolean flag) {
+ this.mc.setTcpKeepAlive(flag);
+ }
+
+ public void setTcpNoDelay(boolean flag) {
+ this.mc.setTcpNoDelay(flag);
+ }
+
+ public void setTcpRcvBuf(int bufSize) {
+ this.mc.setTcpRcvBuf(bufSize);
+ }
+
+ public void setTcpSndBuf(int bufSize) {
+ this.mc.setTcpSndBuf(bufSize);
+ }
+
+ public void setTcpTrafficClass(int classFlags) {
+ this.mc.setTcpTrafficClass(classFlags);
+ }
+
+ public void setTinyInt1isBit(boolean flag) {
+ this.mc.setTinyInt1isBit(flag);
+ }
+
+ public void setTraceProtocol(boolean flag) {
+ this.mc.setTraceProtocol(flag);
+ }
+
+ public void setTransformedBitIsBoolean(boolean flag) {
+ this.mc.setTransformedBitIsBoolean(flag);
+ }
+
+ public void setTreatUtilDateAsTimestamp(boolean flag) {
+ this.mc.setTreatUtilDateAsTimestamp(flag);
+ }
+
+ public void setTrustCertificateKeyStorePassword(String value) {
+ this.mc.setTrustCertificateKeyStorePassword(value);
+ }
+
+ public void setTrustCertificateKeyStoreType(String value) {
+ this.mc.setTrustCertificateKeyStoreType(value);
+ }
+
+ public void setTrustCertificateKeyStoreUrl(String value) {
+ this.mc.setTrustCertificateKeyStoreUrl(value);
+ }
+
+ public void setUltraDevHack(boolean flag) {
+ this.mc.setUltraDevHack(flag);
+ }
+
+ public void setUseBlobToStoreUTF8OutsideBMP(boolean flag) {
+ this.mc.setUseBlobToStoreUTF8OutsideBMP(flag);
+ }
+
+ public void setUseCompression(boolean property) {
+ this.mc.setUseCompression(property);
+ }
+
+ public void setUseConfigs(String configs) {
+ this.mc.setUseConfigs(configs);
+ }
+
+ public void setUseCursorFetch(boolean flag) {
+ this.mc.setUseCursorFetch(flag);
+ }
+
+ public void setUseDirectRowUnpack(boolean flag) {
+ this.mc.setUseDirectRowUnpack(flag);
+ }
+
+ public void setUseDynamicCharsetInfo(boolean flag) {
+ this.mc.setUseDynamicCharsetInfo(flag);
+ }
+
+ public void setUseFastDateParsing(boolean flag) {
+ this.mc.setUseFastDateParsing(flag);
+ }
+
+ public void setUseFastIntParsing(boolean flag) {
+ this.mc.setUseFastIntParsing(flag);
+ }
+
+ public void setUseGmtMillisForDatetimes(boolean flag) {
+ this.mc.setUseGmtMillisForDatetimes(flag);
+ }
+
+ public void setUseHostsInPrivileges(boolean property) {
+ this.mc.setUseHostsInPrivileges(property);
+ }
+
+ public void setUseInformationSchema(boolean flag) {
+ this.mc.setUseInformationSchema(flag);
+ }
+
+ public void setUseJDBCCompliantTimezoneShift(boolean flag) {
+ this.mc.setUseJDBCCompliantTimezoneShift(flag);
+ }
+
+ public void setUseJvmCharsetConverters(boolean flag) {
+ this.mc.setUseJvmCharsetConverters(flag);
+ }
+
+ public void setUseLocalSessionState(boolean flag) {
+ this.mc.setUseLocalSessionState(flag);
+ }
+
+ public void setUseNanosForElapsedTime(boolean flag) {
+ this.mc.setUseNanosForElapsedTime(flag);
+ }
+
+ public void setUseOldAliasMetadataBehavior(boolean flag) {
+ this.mc.setUseOldAliasMetadataBehavior(flag);
+ }
+
+ public void setUseOldUTF8Behavior(boolean flag) {
+ this.mc.setUseOldUTF8Behavior(flag);
+ }
+
+ public void setUseOnlyServerErrorMessages(boolean flag) {
+ this.mc.setUseOnlyServerErrorMessages(flag);
+ }
+
+ public void setUseReadAheadInput(boolean flag) {
+ this.mc.setUseReadAheadInput(flag);
+ }
+
+ public void setUseSSL(boolean property) {
+ this.mc.setUseSSL(property);
+ }
+
+ public void setUseSSPSCompatibleTimezoneShift(boolean flag) {
+ this.mc.setUseSSPSCompatibleTimezoneShift(flag);
+ }
+
+ public void setUseServerPrepStmts(boolean flag) {
+ this.mc.setUseServerPrepStmts(flag);
+ }
+
+ public void setUseServerPreparedStmts(boolean flag) {
+ this.mc.setUseServerPreparedStmts(flag);
+ }
+
+ public void setUseSqlStateCodes(boolean flag) {
+ this.mc.setUseSqlStateCodes(flag);
+ }
+
+ public void setUseStreamLengthsInPrepStmts(boolean property) {
+ this.mc.setUseStreamLengthsInPrepStmts(property);
+ }
+
+ public void setUseTimezone(boolean property) {
+ this.mc.setUseTimezone(property);
+ }
+
+ public void setUseUltraDevWorkAround(boolean property) {
+ this.mc.setUseUltraDevWorkAround(property);
+ }
+
+ public void setUseUnbufferedInput(boolean flag) {
+ this.mc.setUseUnbufferedInput(flag);
+ }
+
+ public void setUseUnicode(boolean flag) {
+ this.mc.setUseUnicode(flag);
+ }
+
+ public void setUseUsageAdvisor(boolean useUsageAdvisorFlag) {
+ this.mc.setUseUsageAdvisor(useUsageAdvisorFlag);
+ }
+
+ public void setUtf8OutsideBmpExcludedColumnNamePattern(String regexPattern) {
+ this.mc.setUtf8OutsideBmpExcludedColumnNamePattern(regexPattern);
+ }
+
+ public void setUtf8OutsideBmpIncludedColumnNamePattern(String regexPattern) {
+ this.mc.setUtf8OutsideBmpIncludedColumnNamePattern(regexPattern);
+ }
+
+ public void setYearIsDateType(boolean flag) {
+ this.mc.setYearIsDateType(flag);
+ }
+
+ public void setZeroDateTimeBehavior(String behavior) {
+ this.mc.setZeroDateTimeBehavior(behavior);
+ }
+
+ public boolean useUnbufferedInput() {
+ return this.mc.useUnbufferedInput();
+ }
}
Copied:
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4CallableStatementWrapper.java
(from rev 6613,
branches/branch_5_1/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4CallableStatementWrapper.java)
Modified:
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4PreparedStatementWrapper.java
===================================================================
---
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4PreparedStatementWrapper.java 2007-10-04
19:50:37 UTC (rev 6615)
+++
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4PreparedStatementWrapper.java 2007-10-04
19:57:22 UTC (rev 6616)
@@ -55,7 +55,7 @@
*/
public class JDBC4PreparedStatementWrapper extends PreparedStatementWrapper {
- JDBC4PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn,
+ public JDBC4PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn,
PreparedStatement toWrap) {
super(c, conn, toWrap);
}
Modified: trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4StatementWrapper.java
===================================================================
---
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4StatementWrapper.java 2007-10-04
19:50:37 UTC (rev 6615)
+++
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/JDBC4StatementWrapper.java 2007-10-04
19:57:22 UTC (rev 6616)
@@ -54,7 +54,7 @@
*/
public class JDBC4StatementWrapper extends StatementWrapper {
- protected JDBC4StatementWrapper(ConnectionWrapper c,
+ public JDBC4StatementWrapper(ConnectionWrapper c,
MysqlPooledConnection conn,
Statement toWrap) {
super(c, conn, toWrap);
Modified:
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/PreparedStatementWrapper.java
===================================================================
---
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/PreparedStatementWrapper.java 2007-10-04
19:50:37 UTC (rev 6615)
+++
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/PreparedStatementWrapper.java 2007-10-04
19:57:22 UTC (rev 6616)
@@ -25,11 +25,13 @@
package com.mysql.jdbc.jdbc2.optional;
import com.mysql.jdbc.SQLError;
+import com.mysql.jdbc.Util;
import com.mysql.jdbc.exceptions.NotYetImplementedException;
import java.io.InputStream;
import java.io.Reader;
+import java.lang.reflect.Constructor;
import java.math.BigDecimal;
import java.net.URL;
@@ -44,6 +46,7 @@
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
+import java.sql.Statement;
//import java.sql.RowId;
import java.sql.SQLException;
//import java.sql.SQLXML;
@@ -63,6 +66,42 @@
*/
public class PreparedStatementWrapper extends StatementWrapper implements
PreparedStatement {
+ private static final Constructor JDBC_4_PREPARED_STATEMENT_WRAPPER_CTOR;
+
+ static {
+ if (Util.isJdbc4()) {
+ try {
+ JDBC_4_PREPARED_STATEMENT_WRAPPER_CTOR = Class.forName(
+ "com.mysql.jdbc.jdbc2.optional.JDBC4PreparedStatementWrapper").getConstructor(
+ new Class[] { ConnectionWrapper.class,
+ MysqlPooledConnection.class,
+ PreparedStatement.class });
+ } catch (SecurityException e) {
+ throw new RuntimeException(e);
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ JDBC_4_PREPARED_STATEMENT_WRAPPER_CTOR = null;
+ }
+ }
+
+ protected static PreparedStatementWrapper getInstance(ConnectionWrapper c,
+ MysqlPooledConnection conn,
+ PreparedStatement toWrap) throws SQLException {
+ if (!Util.isJdbc4()) {
+ return new PreparedStatementWrapper(c,
+ conn, toWrap);
+ }
+
+ return (PreparedStatementWrapper) Util.handleNewInstance(
+ JDBC_4_PREPARED_STATEMENT_WRAPPER_CTOR,
+ new Object[] {c,
+ conn, toWrap });
+ }
+
PreparedStatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn,
PreparedStatement toWrap) {
super(c, conn, toWrap);
Modified: trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/StatementWrapper.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/StatementWrapper.java 2007-10-04
19:50:37 UTC (rev 6615)
+++ trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/StatementWrapper.java 2007-10-04
19:57:22 UTC (rev 6616)
@@ -24,8 +24,11 @@
*/
package com.mysql.jdbc.jdbc2.optional;
+import com.mysql.jdbc.ConnectionImpl;
import com.mysql.jdbc.SQLError;
+import com.mysql.jdbc.Util;
+import java.lang.reflect.Constructor;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -42,11 +45,47 @@
* Exp $
*/
public class StatementWrapper extends WrapperBase implements Statement {
+ private static final Constructor JDBC_4_STATEMENT_WRAPPER_CTOR;
+
+ static {
+ if (Util.isJdbc4()) {
+ try {
+ JDBC_4_STATEMENT_WRAPPER_CTOR = Class.forName(
+ "com.mysql.jdbc.jdbc2.optional.JDBC4StatementWrapper").getConstructor(
+ new Class[] { ConnectionWrapper.class,
+ MysqlPooledConnection.class,
+ Statement.class });
+ } catch (SecurityException e) {
+ throw new RuntimeException(e);
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ JDBC_4_STATEMENT_WRAPPER_CTOR = null;
+ }
+ }
+
+ protected static StatementWrapper getInstance(ConnectionWrapper c,
+ MysqlPooledConnection conn,
+ Statement toWrap) throws SQLException {
+ if (!Util.isJdbc4()) {
+ return new StatementWrapper(c,
+ conn, toWrap);
+ }
+
+ return (StatementWrapper) Util.handleNewInstance(
+ JDBC_4_STATEMENT_WRAPPER_CTOR,
+ new Object[] {c,
+ conn, toWrap });
+ }
+
protected Statement wrappedStmt;
protected ConnectionWrapper wrappedConn;
- protected StatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn,
+ public StatementWrapper(ConnectionWrapper c, MysqlPooledConnection conn,
Statement toWrap) {
this.pooledConnection = conn;
this.wrappedStmt = toWrap;
Modified: trunk/connector-j/src/testsuite/simple/ConnectionTest.java
===================================================================
--- trunk/connector-j/src/testsuite/simple/ConnectionTest.java 2007-10-04 19:50:37 UTC
(rev 6615)
+++ trunk/connector-j/src/testsuite/simple/ConnectionTest.java 2007-10-04 19:57:22 UTC
(rev 6616)
@@ -30,10 +30,14 @@
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.PrintStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.NetworkInterface;
+import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
+import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
@@ -53,6 +57,7 @@
import com.mysql.jdbc.NonRegisteringDriver;
import com.mysql.jdbc.SQLError;
import com.mysql.jdbc.StringUtils;
+import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;
import com.mysql.jdbc.log.StandardLogger;
/**
@@ -1518,4 +1523,71 @@
}
}
}
+
+ public void testInterfaceImplementation() throws Exception {
+ testInterfaceImplementation(getConnectionWithProps((Properties)null));
+ MysqlConnectionPoolDataSource cpds = new MysqlConnectionPoolDataSource();
+ cpds.setUrl(dbUrl);
+ testInterfaceImplementation(cpds.getPooledConnection().getConnection());
+ }
+
+ private void testInterfaceImplementation(Connection connToCheck) throws Exception {
+ Method[] dbmdMethods = java.sql.DatabaseMetaData.class.getMethods();
+
+ // can't do this statically, as we return different
+ // implementations depending on JDBC version
+ DatabaseMetaData dbmd = connToCheck.getMetaData();
+
+ checkInterfaceImplemented(dbmdMethods, dbmd.getClass(), dbmd);
+
+ Statement stmtToCheck = connToCheck.createStatement();
+
+ checkInterfaceImplemented(java.sql.Statement.class.getMethods(),
stmtToCheck.getClass(), stmtToCheck);
+
+ PreparedStatement pStmtToCheck = connToCheck.prepareStatement("SELECT 1");
+ ParameterMetaData paramMd = pStmtToCheck.getParameterMetaData();
+
+ checkInterfaceImplemented(java.sql.PreparedStatement.class.getMethods(),
pStmtToCheck.getClass(), pStmtToCheck);
+ checkInterfaceImplemented(java.sql.ParameterMetaData.class.getMethods(),
paramMd.getClass(), paramMd);
+
+ pStmtToCheck = ((com.mysql.jdbc.Connection)
connToCheck).serverPrepareStatement("SELECT 1");
+
+ checkInterfaceImplemented(java.sql.PreparedStatement.class.getMethods(),
pStmtToCheck.getClass(), pStmtToCheck);
+ ResultSet toCheckRs = connToCheck.createStatement().executeQuery("SELECT 1");
+ checkInterfaceImplemented(java.sql.ResultSet.class.getMethods(),
toCheckRs.getClass(), toCheckRs);
+ toCheckRs = connToCheck.createStatement().executeQuery("SELECT 1");
+ checkInterfaceImplemented(java.sql.ResultSetMetaData.class.getMethods(),
toCheckRs.getMetaData().getClass(), toCheckRs.getMetaData());
+
+ if (versionMeetsMinimum(5, 0, 0)) {
+ createProcedure("interfaceImpl", "(IN p1 INT)\nBEGIN\nSELECT 1;\nEND");
+
+ CallableStatement cstmt = connToCheck.prepareCall("{CALL interfaceImpl(?)}");
+
+ checkInterfaceImplemented(java.sql.CallableStatement.class.getMethods(),
cstmt.getClass(), cstmt);
+ }
+ checkInterfaceImplemented(java.sql.Connection.class.getMethods(),
connToCheck.getClass(), connToCheck);
+ }
+
+ private void checkInterfaceImplemented(Method[] interfaceMethods,
+ Class implementingClass, Object invokeOn) throws NoSuchMethodException {
+ for (int i = 0; i < interfaceMethods.length; i++) {
+ Method toFind = interfaceMethods[i];
+ Method toMatch = implementingClass.getMethod(toFind.getName(),
toFind.getParameterTypes());
+ assertNotNull(toFind.toString(), toMatch);
+
+ Object[] args = new Object[toFind.getParameterTypes().length];
+
+ try {
+ toMatch.invoke(invokeOn, args);
+ } catch (IllegalArgumentException e) {
+
+ } catch (IllegalAccessException e) {
+
+ } catch (InvocationTargetException e) {
+
+ } catch (java.lang.AbstractMethodError e) {
+ throw e;
+ }
+ }
+ }
}
| Thread |
|---|
| • Connector/J commit: r6616 - in trunk: . connector-j/src/com/mysql/jdbc connector-j/src/com/mysql/jdbc/jdbc2/optional connector-j/src/testsuite/simple | mmatthews | 4 Oct |