PageRenderTime 29ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 1ms

/branches/ui/project/mysql-connector/src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java

https://bitbucket.org/novelli/josser
Java | 1941 lines | 1298 code | 382 blank | 261 comment | 23 complexity | 6ce51f106b103568326c13660a106b49 MD5 | raw file
Possible License(s): Apache-2.0, GPL-2.0, LGPL-2.1, BSD-3-Clause
  1. /*
  2. Copyright 2002-2007 MySQL AB, 2008-2009 Sun Microsystems
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of version 2 of the GNU General Public License as
  5. published by the Free Software Foundation.
  6. There are special exceptions to the terms and conditions of the GPL
  7. as it is applied to this software. View the full text of the
  8. exception in file EXCEPTIONS-CONNECTOR-J in the directory of this
  9. software distribution.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. package com.mysql.jdbc.jdbc2.optional;
  19. import java.lang.reflect.Constructor;
  20. import java.sql.SQLException;
  21. import java.sql.Savepoint;
  22. import java.sql.Statement;
  23. import java.util.Map;
  24. import java.util.TimeZone;
  25. import com.mysql.jdbc.Connection;
  26. import com.mysql.jdbc.ExceptionInterceptor;
  27. import com.mysql.jdbc.Extension;
  28. import com.mysql.jdbc.MysqlErrorNumbers;
  29. import com.mysql.jdbc.SQLError;
  30. import com.mysql.jdbc.Util;
  31. import com.mysql.jdbc.log.Log;
  32. /**
  33. * This class serves as a wrapper for the org.gjt.mm.mysql.jdbc2.Connection
  34. * class. It is returned to the application server which may wrap it again and
  35. * then return it to the application client in response to
  36. * dataSource.getConnection().
  37. *
  38. * <p>
  39. * All method invocations are forwarded to org.gjt.mm.mysql.jdbc2.Connection
  40. * unless the close method was previously called, in which case a sqlException
  41. * is thrown. The close method performs a 'logical close' on the connection.
  42. * </p>
  43. *
  44. * <p>
  45. * All sqlExceptions thrown by the physical connection are intercepted and sent
  46. * to connectionEvent listeners before being thrown to client.
  47. * </p>
  48. *
  49. * @author Todd Wolff todd.wolff_at_prodigy.net
  50. *
  51. * @see org.gjt.mm.mysql.jdbc2.Connection
  52. * @see org.gjt.mm.mysql.jdbc2.optional.MysqlPooledConnection
  53. */
  54. public class ConnectionWrapper extends WrapperBase implements Connection {
  55. protected Connection mc = null;
  56. private String invalidHandleStr = "Logical handle no longer valid";
  57. private boolean closed;
  58. private boolean isForXa;
  59. private static final Constructor JDBC_4_CONNECTION_WRAPPER_CTOR;
  60. static {
  61. if (Util.isJdbc4()) {
  62. try {
  63. JDBC_4_CONNECTION_WRAPPER_CTOR = Class.forName(
  64. "com.mysql.jdbc.jdbc2.optional.JDBC4ConnectionWrapper")
  65. .getConstructor(
  66. new Class[] { MysqlPooledConnection.class,
  67. Connection.class, Boolean.TYPE });
  68. } catch (SecurityException e) {
  69. throw new RuntimeException(e);
  70. } catch (NoSuchMethodException e) {
  71. throw new RuntimeException(e);
  72. } catch (ClassNotFoundException e) {
  73. throw new RuntimeException(e);
  74. }
  75. } else {
  76. JDBC_4_CONNECTION_WRAPPER_CTOR = null;
  77. }
  78. }
  79. protected static ConnectionWrapper getInstance(
  80. MysqlPooledConnection mysqlPooledConnection,
  81. Connection mysqlConnection, boolean forXa) throws SQLException {
  82. if (!Util.isJdbc4()) {
  83. return new ConnectionWrapper(mysqlPooledConnection,
  84. mysqlConnection, forXa);
  85. }
  86. return (ConnectionWrapper) Util.handleNewInstance(
  87. JDBC_4_CONNECTION_WRAPPER_CTOR, new Object[] {
  88. mysqlPooledConnection, mysqlConnection,
  89. Boolean.valueOf(forXa) }, mysqlPooledConnection.getExceptionInterceptor());
  90. }
  91. /**
  92. * Construct a new LogicalHandle and set instance variables
  93. *
  94. * @param mysqlPooledConnection
  95. * reference to object that instantiated this object
  96. * @param mysqlConnection
  97. * physical connection to db
  98. *
  99. * @throws SQLException
  100. * if an error occurs.
  101. */
  102. public ConnectionWrapper(MysqlPooledConnection mysqlPooledConnection,
  103. Connection mysqlConnection, boolean forXa) throws SQLException {
  104. super(mysqlPooledConnection);
  105. this.mc = mysqlConnection;
  106. this.closed = false;
  107. this.isForXa = forXa;
  108. if (this.isForXa) {
  109. setInGlobalTx(false);
  110. }
  111. }
  112. /**
  113. * Passes call to method on physical connection instance. Notifies listeners
  114. * of any caught exceptions before re-throwing to client.
  115. *
  116. * @see java.sql.Connection#setAutoCommit
  117. */
  118. public void setAutoCommit(boolean autoCommit) throws SQLException {
  119. checkClosed();
  120. if (autoCommit && isInGlobalTx()) {
  121. throw SQLError.createSQLException(
  122. "Can't set autocommit to 'true' on an XAConnection",
  123. SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
  124. MysqlErrorNumbers.ER_XA_RMERR, this.exceptionInterceptor);
  125. }
  126. try {
  127. this.mc.setAutoCommit(autoCommit);
  128. } catch (SQLException sqlException) {
  129. checkAndFireConnectionError(sqlException);
  130. }
  131. }
  132. /**
  133. * Passes call to method on physical connection instance. Notifies listeners
  134. * of any caught exceptions before re-throwing to client.
  135. *
  136. * @see java.sql.Connection#getAutoCommit()
  137. */
  138. public boolean getAutoCommit() throws SQLException {
  139. checkClosed();
  140. try {
  141. return this.mc.getAutoCommit();
  142. } catch (SQLException sqlException) {
  143. checkAndFireConnectionError(sqlException);
  144. }
  145. return false; // we don't reach this code, compiler can't tell
  146. }
  147. /**
  148. * Passes call to method on physical connection instance. Notifies listeners
  149. * of any caught exceptions before re-throwing to client.
  150. *
  151. * @see java.sql.Connection#setCatalog()
  152. */
  153. public void setCatalog(String catalog) throws SQLException {
  154. checkClosed();
  155. try {
  156. this.mc.setCatalog(catalog);
  157. } catch (SQLException sqlException) {
  158. checkAndFireConnectionError(sqlException);
  159. }
  160. }
  161. /**
  162. * Passes call to method on physical connection instance. Notifies listeners
  163. * of any caught exceptions before re-throwing to client.
  164. *
  165. * @return the current catalog
  166. *
  167. * @throws SQLException
  168. * if an error occurs
  169. */
  170. public String getCatalog() throws SQLException {
  171. checkClosed();
  172. try {
  173. return this.mc.getCatalog();
  174. } catch (SQLException sqlException) {
  175. checkAndFireConnectionError(sqlException);
  176. }
  177. return null; // we don't reach this code, compiler can't tell
  178. }
  179. /**
  180. * Passes call to method on physical connection instance. Notifies listeners
  181. * of any caught exceptions before re-throwing to client.
  182. *
  183. * @see java.sql.Connection#isClosed()
  184. */
  185. public boolean isClosed() throws SQLException {
  186. return (this.closed || this.mc.isClosed());
  187. }
  188. public boolean isMasterConnection() {
  189. return this.mc.isMasterConnection();
  190. }
  191. /**
  192. * @see Connection#setHoldability(int)
  193. */
  194. public void setHoldability(int arg0) throws SQLException {
  195. checkClosed();
  196. try {
  197. this.mc.setHoldability(arg0);
  198. } catch (SQLException sqlException) {
  199. checkAndFireConnectionError(sqlException);
  200. }
  201. }
  202. /**
  203. * @see Connection#getHoldability()
  204. */
  205. public int getHoldability() throws SQLException {
  206. checkClosed();
  207. try {
  208. return this.mc.getHoldability();
  209. } catch (SQLException sqlException) {
  210. checkAndFireConnectionError(sqlException);
  211. }
  212. return Statement.CLOSE_CURRENT_RESULT; // we don't reach this code,
  213. // compiler can't tell
  214. }
  215. /**
  216. * Allows clients to determine how long this connection has been idle.
  217. *
  218. * @return how long the connection has been idle.
  219. */
  220. public long getIdleFor() {
  221. return this.mc.getIdleFor();
  222. }
  223. /**
  224. * Passes call to method on physical connection instance. Notifies listeners
  225. * of any caught exceptions before re-throwing to client.
  226. *
  227. * @return a metadata instance
  228. *
  229. * @throws SQLException
  230. * if an error occurs
  231. */
  232. public java.sql.DatabaseMetaData getMetaData() throws SQLException {
  233. checkClosed();
  234. try {
  235. return this.mc.getMetaData();
  236. } catch (SQLException sqlException) {
  237. checkAndFireConnectionError(sqlException);
  238. }
  239. return null; // we don't reach this code, compiler can't tell
  240. }
  241. /**
  242. * Passes call to method on physical connection instance. Notifies listeners
  243. * of any caught exceptions before re-throwing to client.
  244. *
  245. * @see java.sql.Connection#setReadOnly()
  246. */
  247. public void setReadOnly(boolean readOnly) throws SQLException {
  248. checkClosed();
  249. try {
  250. this.mc.setReadOnly(readOnly);
  251. } catch (SQLException sqlException) {
  252. checkAndFireConnectionError(sqlException);
  253. }
  254. }
  255. /**
  256. * Passes call to method on physical connection instance. Notifies listeners
  257. * of any caught exceptions before re-throwing to client.
  258. *
  259. * @see java.sql.Connection#isReadOnly()
  260. */
  261. public boolean isReadOnly() throws SQLException {
  262. checkClosed();
  263. try {
  264. return this.mc.isReadOnly();
  265. } catch (SQLException sqlException) {
  266. checkAndFireConnectionError(sqlException);
  267. }
  268. return false; // we don't reach this code, compiler can't tell
  269. }
  270. /**
  271. * @see Connection#setSavepoint()
  272. */
  273. public java.sql.Savepoint setSavepoint() throws SQLException {
  274. checkClosed();
  275. if (isInGlobalTx()) {
  276. throw SQLError.createSQLException(
  277. "Can't set autocommit to 'true' on an XAConnection",
  278. SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
  279. MysqlErrorNumbers.ER_XA_RMERR, this.exceptionInterceptor);
  280. }
  281. try {
  282. return this.mc.setSavepoint();
  283. } catch (SQLException sqlException) {
  284. checkAndFireConnectionError(sqlException);
  285. }
  286. return null; // we don't reach this code, compiler can't tell
  287. }
  288. /**
  289. * @see Connection#setSavepoint(String)
  290. */
  291. public java.sql.Savepoint setSavepoint(String arg0) throws SQLException {
  292. checkClosed();
  293. if (isInGlobalTx()) {
  294. throw SQLError.createSQLException(
  295. "Can't set autocommit to 'true' on an XAConnection",
  296. SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
  297. MysqlErrorNumbers.ER_XA_RMERR, this.exceptionInterceptor);
  298. }
  299. try {
  300. return this.mc.setSavepoint(arg0);
  301. } catch (SQLException sqlException) {
  302. checkAndFireConnectionError(sqlException);
  303. }
  304. return null; // we don't reach this code, compiler can't tell
  305. }
  306. /**
  307. * Passes call to method on physical connection instance. Notifies listeners
  308. * of any caught exceptions before re-throwing to client.
  309. *
  310. * @see java.sql.Connection#setTransactionIsolation()
  311. */
  312. public void setTransactionIsolation(int level) throws SQLException {
  313. checkClosed();
  314. try {
  315. this.mc.setTransactionIsolation(level);
  316. } catch (SQLException sqlException) {
  317. checkAndFireConnectionError(sqlException);
  318. }
  319. }
  320. /**
  321. * Passes call to method on physical connection instance. Notifies listeners
  322. * of any caught exceptions before re-throwing to client.
  323. *
  324. * @see java.sql.Connection#getTransactionIsolation()
  325. */
  326. public int getTransactionIsolation() throws SQLException {
  327. checkClosed();
  328. try {
  329. return this.mc.getTransactionIsolation();
  330. } catch (SQLException sqlException) {
  331. checkAndFireConnectionError(sqlException);
  332. }
  333. return TRANSACTION_REPEATABLE_READ; // we don't reach this code,
  334. // compiler can't tell
  335. }
  336. /**
  337. * Passes call to method on physical connection instance. Notifies listeners
  338. * of any caught exceptions before re-throwing to client.
  339. *
  340. * @see java.sql.Connection#setTypeMap()
  341. */
  342. public void setTypeMap(java.util.Map map) throws SQLException {
  343. checkClosed();
  344. try {
  345. this.mc.setTypeMap(map);
  346. } catch (SQLException sqlException) {
  347. checkAndFireConnectionError(sqlException);
  348. }
  349. }
  350. /**
  351. * Passes call to method on physical connection instance. Notifies listeners
  352. * of any caught exceptions before re-throwing to client.
  353. *
  354. * @see java.sql.Connection#getTypeMap()
  355. */
  356. public java.util.Map getTypeMap() throws SQLException {
  357. checkClosed();
  358. try {
  359. return this.mc.getTypeMap();
  360. } catch (SQLException sqlException) {
  361. checkAndFireConnectionError(sqlException);
  362. }
  363. return null; // we don't reach this code, compiler can't tell
  364. }
  365. /**
  366. * Passes call to method on physical connection instance. Notifies listeners
  367. * of any caught exceptions before re-throwing to client.
  368. *
  369. * @see java.sql.Connection#getWarnings
  370. */
  371. public java.sql.SQLWarning getWarnings() throws SQLException {
  372. checkClosed();
  373. try {
  374. return this.mc.getWarnings();
  375. } catch (SQLException sqlException) {
  376. checkAndFireConnectionError(sqlException);
  377. }
  378. return null; // we don't reach this code, compiler can't tell
  379. }
  380. /**
  381. * Passes call to method on physical connection instance. Notifies listeners
  382. * of any caught exceptions before re-throwing to client.
  383. *
  384. * @throws SQLException
  385. * if an error occurs
  386. */
  387. public void clearWarnings() throws SQLException {
  388. checkClosed();
  389. try {
  390. this.mc.clearWarnings();
  391. } catch (SQLException sqlException) {
  392. checkAndFireConnectionError(sqlException);
  393. }
  394. }
  395. /**
  396. * The physical connection is not actually closed. the physical connection
  397. * is closed when the application server calls
  398. * mysqlPooledConnection.close(). this object is de-referenced by the pooled
  399. * connection each time mysqlPooledConnection.getConnection() is called by
  400. * app server.
  401. *
  402. * @throws SQLException
  403. * if an error occurs
  404. */
  405. public void close() throws SQLException {
  406. close(true);
  407. }
  408. /**
  409. * Passes call to method on physical connection instance. Notifies listeners
  410. * of any caught exceptions before re-throwing to client.
  411. *
  412. * @throws SQLException
  413. * if an error occurs
  414. */
  415. public void commit() throws SQLException {
  416. checkClosed();
  417. if (isInGlobalTx()) {
  418. throw SQLError
  419. .createSQLException(
  420. "Can't call commit() on an XAConnection associated with a global transaction",
  421. SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
  422. MysqlErrorNumbers.ER_XA_RMERR, this.exceptionInterceptor);
  423. }
  424. try {
  425. this.mc.commit();
  426. } catch (SQLException sqlException) {
  427. checkAndFireConnectionError(sqlException);
  428. }
  429. }
  430. /**
  431. * Passes call to method on physical connection instance. Notifies listeners
  432. * of any caught exceptions before re-throwing to client.
  433. *
  434. * @see java.sql.Connection#createStatement()
  435. */
  436. public java.sql.Statement createStatement() throws SQLException {
  437. checkClosed();
  438. try {
  439. return StatementWrapper.getInstance(this, this.pooledConnection, this.mc
  440. .createStatement());
  441. } catch (SQLException sqlException) {
  442. checkAndFireConnectionError(sqlException);
  443. }
  444. return null; // we don't reach this code, compiler can't tell
  445. }
  446. /**
  447. * Passes call to method on physical connection instance. Notifies listeners
  448. * of any caught exceptions before re-throwing to client.
  449. *
  450. * @see java.sql.Connection#createStatement()
  451. */
  452. public java.sql.Statement createStatement(int resultSetType,
  453. int resultSetConcurrency) throws SQLException {
  454. checkClosed();
  455. try {
  456. return StatementWrapper.getInstance(this, this.pooledConnection, this.mc
  457. .createStatement(resultSetType, resultSetConcurrency));
  458. } catch (SQLException sqlException) {
  459. checkAndFireConnectionError(sqlException);
  460. }
  461. return null; // we don't reach this code, compiler can't tell
  462. }
  463. /**
  464. * @see Connection#createStatement(int, int, int)
  465. */
  466. public java.sql.Statement createStatement(int arg0, int arg1, int arg2)
  467. throws SQLException {
  468. checkClosed();
  469. try {
  470. return StatementWrapper.getInstance(this, this.pooledConnection, this.mc
  471. .createStatement(arg0, arg1, arg2));
  472. } catch (SQLException sqlException) {
  473. checkAndFireConnectionError(sqlException);
  474. }
  475. return null; // we don't reach this code, compiler can't tell
  476. }
  477. /**
  478. * Passes call to method on physical connection instance. Notifies listeners
  479. * of any caught exceptions before re-throwing to client.
  480. *
  481. * @see java.sql.Connection#nativeSQL()
  482. */
  483. public String nativeSQL(String sql) throws SQLException {
  484. checkClosed();
  485. try {
  486. return this.mc.nativeSQL(sql);
  487. } catch (SQLException sqlException) {
  488. checkAndFireConnectionError(sqlException);
  489. }
  490. return null; // we don't reach this code, compiler can't tell
  491. }
  492. /**
  493. * Passes call to method on physical connection instance. Notifies listeners
  494. * of any caught exceptions before re-throwing to client.
  495. *
  496. * @see java.sql.Connection#prepareCall()
  497. */
  498. public java.sql.CallableStatement prepareCall(String sql)
  499. throws SQLException {
  500. checkClosed();
  501. try {
  502. return CallableStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  503. .prepareCall(sql));
  504. } catch (SQLException sqlException) {
  505. checkAndFireConnectionError(sqlException);
  506. }
  507. return null; // we don't reach this code, compiler can't tell
  508. }
  509. /**
  510. * Passes call to method on physical connection instance. Notifies listeners
  511. * of any caught exceptions before re-throwing to client.
  512. *
  513. * @see java.sql.Connection#prepareCall()
  514. */
  515. public java.sql.CallableStatement prepareCall(String sql,
  516. int resultSetType, int resultSetConcurrency) throws SQLException {
  517. checkClosed();
  518. try {
  519. return CallableStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  520. .prepareCall(sql, resultSetType, resultSetConcurrency));
  521. } catch (SQLException sqlException) {
  522. checkAndFireConnectionError(sqlException);
  523. }
  524. return null; // we don't reach this code, compiler can't tell
  525. }
  526. /**
  527. * @see Connection#prepareCall(String, int, int, int)
  528. */
  529. public java.sql.CallableStatement prepareCall(String arg0, int arg1,
  530. int arg2, int arg3) throws SQLException {
  531. checkClosed();
  532. try {
  533. return CallableStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  534. .prepareCall(arg0, arg1, arg2, arg3));
  535. } catch (SQLException sqlException) {
  536. checkAndFireConnectionError(sqlException);
  537. }
  538. return null; // we don't reach this code, compiler can't tell
  539. }
  540. public java.sql.PreparedStatement clientPrepare(String sql)
  541. throws SQLException {
  542. checkClosed();
  543. try {
  544. return new PreparedStatementWrapper(this, this.pooledConnection, this.mc
  545. .clientPrepareStatement(sql));
  546. } catch (SQLException sqlException) {
  547. checkAndFireConnectionError(sqlException);
  548. }
  549. return null;
  550. }
  551. public java.sql.PreparedStatement clientPrepare(String sql,
  552. int resultSetType, int resultSetConcurrency) throws SQLException {
  553. checkClosed();
  554. try {
  555. return new PreparedStatementWrapper(this, this.pooledConnection, this.mc
  556. .clientPrepareStatement(sql, resultSetType,
  557. resultSetConcurrency));
  558. } catch (SQLException sqlException) {
  559. checkAndFireConnectionError(sqlException);
  560. }
  561. return null;
  562. }
  563. /**
  564. * Passes call to method on physical connection instance. Notifies listeners
  565. * of any caught exceptions before re-throwing to client.
  566. *
  567. * @see java.sql.Connection#prepareStatement()
  568. */
  569. public java.sql.PreparedStatement prepareStatement(String sql)
  570. throws SQLException {
  571. checkClosed();
  572. try {
  573. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  574. .prepareStatement(sql));
  575. } catch (SQLException sqlException) {
  576. checkAndFireConnectionError(sqlException);
  577. }
  578. return null; // we don't reach this code, compiler can't tell
  579. }
  580. /**
  581. * Passes call to method on physical connection instance. Notifies listeners
  582. * of any caught exceptions before re-throwing to client.
  583. *
  584. * @see java.sql.Connection#prepareStatement()
  585. */
  586. public java.sql.PreparedStatement prepareStatement(String sql,
  587. int resultSetType, int resultSetConcurrency) throws SQLException {
  588. checkClosed();
  589. try {
  590. return PreparedStatementWrapper
  591. .getInstance(this, this.pooledConnection, this.mc.prepareStatement(sql,
  592. resultSetType, resultSetConcurrency));
  593. } catch (SQLException sqlException) {
  594. checkAndFireConnectionError(sqlException);
  595. }
  596. return null; // we don't reach this code, compiler can't tell
  597. }
  598. /**
  599. * @see Connection#prepareStatement(String, int, int, int)
  600. */
  601. public java.sql.PreparedStatement prepareStatement(String arg0, int arg1,
  602. int arg2, int arg3) throws SQLException {
  603. checkClosed();
  604. try {
  605. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  606. .prepareStatement(arg0, arg1, arg2, arg3));
  607. } catch (SQLException sqlException) {
  608. checkAndFireConnectionError(sqlException);
  609. }
  610. return null; // we don't reach this code, compiler can't tell
  611. }
  612. /**
  613. * @see Connection#prepareStatement(String, int)
  614. */
  615. public java.sql.PreparedStatement prepareStatement(String arg0, int arg1)
  616. throws SQLException {
  617. checkClosed();
  618. try {
  619. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  620. .prepareStatement(arg0, arg1));
  621. } catch (SQLException sqlException) {
  622. checkAndFireConnectionError(sqlException);
  623. }
  624. return null; // we don't reach this code, compiler can't tell
  625. }
  626. /**
  627. * @see Connection#prepareStatement(String, int[])
  628. */
  629. public java.sql.PreparedStatement prepareStatement(String arg0, int[] arg1)
  630. throws SQLException {
  631. checkClosed();
  632. try {
  633. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  634. .prepareStatement(arg0, arg1));
  635. } catch (SQLException sqlException) {
  636. checkAndFireConnectionError(sqlException);
  637. }
  638. return null; // we don't reach this code, compiler can't tell
  639. }
  640. /**
  641. * @see Connection#prepareStatement(String, String[])
  642. */
  643. public java.sql.PreparedStatement prepareStatement(String arg0,
  644. String[] arg1) throws SQLException {
  645. checkClosed();
  646. try {
  647. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  648. .prepareStatement(arg0, arg1));
  649. } catch (SQLException sqlException) {
  650. checkAndFireConnectionError(sqlException);
  651. }
  652. return null; // we don't reach this code, compiler can't tell
  653. }
  654. /**
  655. * @see Connection#releaseSavepoint(Savepoint)
  656. */
  657. public void releaseSavepoint(Savepoint arg0) throws SQLException {
  658. checkClosed();
  659. try {
  660. this.mc.releaseSavepoint(arg0);
  661. } catch (SQLException sqlException) {
  662. checkAndFireConnectionError(sqlException);
  663. }
  664. }
  665. /**
  666. * Passes call to method on physical connection instance. Notifies listeners
  667. * of any caught exceptions before re-throwing to client.
  668. *
  669. * @see java.sql.Connection#rollback()
  670. */
  671. public void rollback() throws SQLException {
  672. checkClosed();
  673. if (isInGlobalTx()) {
  674. throw SQLError
  675. .createSQLException(
  676. "Can't call rollback() on an XAConnection associated with a global transaction",
  677. SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
  678. MysqlErrorNumbers.ER_XA_RMERR, this.exceptionInterceptor);
  679. }
  680. try {
  681. this.mc.rollback();
  682. } catch (SQLException sqlException) {
  683. checkAndFireConnectionError(sqlException);
  684. }
  685. }
  686. /**
  687. * @see Connection#rollback(Savepoint)
  688. */
  689. public void rollback(Savepoint arg0) throws SQLException {
  690. checkClosed();
  691. if (isInGlobalTx()) {
  692. throw SQLError
  693. .createSQLException(
  694. "Can't call rollback() on an XAConnection associated with a global transaction",
  695. SQLError.SQL_STATE_INVALID_TRANSACTION_TERMINATION,
  696. MysqlErrorNumbers.ER_XA_RMERR, this.exceptionInterceptor);
  697. }
  698. try {
  699. this.mc.rollback(arg0);
  700. } catch (SQLException sqlException) {
  701. checkAndFireConnectionError(sqlException);
  702. }
  703. }
  704. public boolean isSameResource(Connection c) {
  705. if (c instanceof ConnectionWrapper) {
  706. return this.mc.isSameResource(((ConnectionWrapper) c).mc);
  707. } else if (c instanceof com.mysql.jdbc.Connection) {
  708. return this.mc.isSameResource((com.mysql.jdbc.Connection) c);
  709. }
  710. return false;
  711. }
  712. protected void close(boolean fireClosedEvent) throws SQLException {
  713. synchronized (this.pooledConnection) {
  714. if (this.closed) {
  715. return;
  716. }
  717. if (!isInGlobalTx() && this.mc.getRollbackOnPooledClose()
  718. && !this.getAutoCommit()) {
  719. rollback();
  720. }
  721. if (fireClosedEvent) {
  722. this.pooledConnection.callConnectionEventListeners(
  723. MysqlPooledConnection.CONNECTION_CLOSED_EVENT, null);
  724. }
  725. // set closed status to true so that if application client tries to
  726. // make additional
  727. // calls a sqlException will be thrown. The physical connection is
  728. // re-used by the pooled connection each time getConnection is
  729. // called.
  730. this.closed = true;
  731. }
  732. }
  733. protected void checkClosed() throws SQLException {
  734. if (this.closed) {
  735. throw SQLError.createSQLException(this.invalidHandleStr, this.exceptionInterceptor);
  736. }
  737. }
  738. public boolean isInGlobalTx() {
  739. return this.mc.isInGlobalTx();
  740. }
  741. public void setInGlobalTx(boolean flag) {
  742. this.mc.setInGlobalTx(flag);
  743. }
  744. public void ping() throws SQLException {
  745. if (this.mc != null) {
  746. this.mc.ping();
  747. }
  748. }
  749. public void changeUser(String userName, String newPassword)
  750. throws SQLException {
  751. checkClosed();
  752. try {
  753. this.mc.changeUser(userName, newPassword);
  754. } catch (SQLException sqlException) {
  755. checkAndFireConnectionError(sqlException);
  756. }
  757. }
  758. public void clearHasTriedMaster() {
  759. this.mc.clearHasTriedMaster();
  760. }
  761. public java.sql.PreparedStatement clientPrepareStatement(String sql)
  762. throws SQLException {
  763. checkClosed();
  764. try {
  765. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  766. .clientPrepareStatement(sql));
  767. } catch (SQLException sqlException) {
  768. checkAndFireConnectionError(sqlException);
  769. }
  770. return null;
  771. }
  772. public java.sql.PreparedStatement clientPrepareStatement(String sql,
  773. int autoGenKeyIndex) throws SQLException {
  774. try {
  775. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  776. .clientPrepareStatement(sql, autoGenKeyIndex));
  777. } catch (SQLException sqlException) {
  778. checkAndFireConnectionError(sqlException);
  779. }
  780. return null;
  781. }
  782. public java.sql.PreparedStatement clientPrepareStatement(String sql,
  783. int resultSetType, int resultSetConcurrency) throws SQLException {
  784. try {
  785. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  786. .clientPrepareStatement(sql, resultSetType,
  787. resultSetConcurrency));
  788. } catch (SQLException sqlException) {
  789. checkAndFireConnectionError(sqlException);
  790. }
  791. return null;
  792. }
  793. public java.sql.PreparedStatement clientPrepareStatement(String sql,
  794. int resultSetType, int resultSetConcurrency,
  795. int resultSetHoldability) throws SQLException {
  796. try {
  797. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  798. .clientPrepareStatement(sql, resultSetType,
  799. resultSetConcurrency, resultSetHoldability));
  800. } catch (SQLException sqlException) {
  801. checkAndFireConnectionError(sqlException);
  802. }
  803. return null;
  804. }
  805. public java.sql.PreparedStatement clientPrepareStatement(String sql,
  806. int[] autoGenKeyIndexes) throws SQLException {
  807. try {
  808. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  809. .clientPrepareStatement(sql, autoGenKeyIndexes));
  810. } catch (SQLException sqlException) {
  811. checkAndFireConnectionError(sqlException);
  812. }
  813. return null;
  814. }
  815. public java.sql.PreparedStatement clientPrepareStatement(String sql,
  816. String[] autoGenKeyColNames) throws SQLException {
  817. try {
  818. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  819. .clientPrepareStatement(sql, autoGenKeyColNames));
  820. } catch (SQLException sqlException) {
  821. checkAndFireConnectionError(sqlException);
  822. }
  823. return null;
  824. }
  825. public int getActiveStatementCount() {
  826. return this.mc.getActiveStatementCount();
  827. }
  828. public Log getLog() throws SQLException {
  829. return this.mc.getLog();
  830. }
  831. public String getServerCharacterEncoding() {
  832. return this.mc.getServerCharacterEncoding();
  833. }
  834. public TimeZone getServerTimezoneTZ() {
  835. return this.mc.getServerTimezoneTZ();
  836. }
  837. public String getStatementComment() {
  838. return this.mc.getStatementComment();
  839. }
  840. public boolean hasTriedMaster() {
  841. return this.mc.hasTriedMaster();
  842. }
  843. public boolean isAbonormallyLongQuery(long millisOrNanos) {
  844. return this.mc.isAbonormallyLongQuery(millisOrNanos);
  845. }
  846. public boolean isNoBackslashEscapesSet() {
  847. return this.mc.isNoBackslashEscapesSet();
  848. }
  849. public boolean lowerCaseTableNames() {
  850. return this.mc.lowerCaseTableNames();
  851. }
  852. public boolean parserKnowsUnicode() {
  853. return this.mc.parserKnowsUnicode();
  854. }
  855. public void reportQueryTime(long millisOrNanos) {
  856. this.mc.reportQueryTime(millisOrNanos);
  857. }
  858. public void resetServerState() throws SQLException {
  859. checkClosed();
  860. try {
  861. this.mc.resetServerState();
  862. } catch (SQLException sqlException) {
  863. checkAndFireConnectionError(sqlException);
  864. }
  865. }
  866. public java.sql.PreparedStatement serverPrepareStatement(String sql)
  867. throws SQLException {
  868. checkClosed();
  869. try {
  870. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  871. .serverPrepareStatement(sql));
  872. } catch (SQLException sqlException) {
  873. checkAndFireConnectionError(sqlException);
  874. }
  875. return null;
  876. }
  877. public java.sql.PreparedStatement serverPrepareStatement(String sql,
  878. int autoGenKeyIndex) throws SQLException {
  879. try {
  880. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  881. .serverPrepareStatement(sql, autoGenKeyIndex));
  882. } catch (SQLException sqlException) {
  883. checkAndFireConnectionError(sqlException);
  884. }
  885. return null;
  886. }
  887. public java.sql.PreparedStatement serverPrepareStatement(String sql,
  888. int resultSetType, int resultSetConcurrency) throws SQLException {
  889. try {
  890. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  891. .serverPrepareStatement(sql, resultSetType,
  892. resultSetConcurrency));
  893. } catch (SQLException sqlException) {
  894. checkAndFireConnectionError(sqlException);
  895. }
  896. return null;
  897. }
  898. public java.sql.PreparedStatement serverPrepareStatement(String sql,
  899. int resultSetType, int resultSetConcurrency,
  900. int resultSetHoldability) throws SQLException {
  901. try {
  902. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  903. .serverPrepareStatement(sql, resultSetType,
  904. resultSetConcurrency, resultSetHoldability));
  905. } catch (SQLException sqlException) {
  906. checkAndFireConnectionError(sqlException);
  907. }
  908. return null;
  909. }
  910. public java.sql.PreparedStatement serverPrepareStatement(String sql,
  911. int[] autoGenKeyIndexes) throws SQLException {
  912. try {
  913. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  914. .serverPrepareStatement(sql, autoGenKeyIndexes));
  915. } catch (SQLException sqlException) {
  916. checkAndFireConnectionError(sqlException);
  917. }
  918. return null;
  919. }
  920. public java.sql.PreparedStatement serverPrepareStatement(String sql,
  921. String[] autoGenKeyColNames) throws SQLException {
  922. try {
  923. return PreparedStatementWrapper.getInstance(this, this.pooledConnection, this.mc
  924. .serverPrepareStatement(sql, autoGenKeyColNames));
  925. } catch (SQLException sqlException) {
  926. checkAndFireConnectionError(sqlException);
  927. }
  928. return null;
  929. }
  930. public void setFailedOver(boolean flag) {
  931. this.mc.setFailedOver(flag);
  932. }
  933. public void setPreferSlaveDuringFailover(boolean flag) {
  934. this.mc.setPreferSlaveDuringFailover(flag);
  935. }
  936. public void setStatementComment(String comment) {
  937. this.mc.setStatementComment(comment);
  938. }
  939. public void shutdownServer() throws SQLException {
  940. checkClosed();
  941. try {
  942. this.mc.shutdownServer();
  943. } catch (SQLException sqlException) {
  944. checkAndFireConnectionError(sqlException);
  945. }
  946. }
  947. public boolean supportsIsolationLevel() {
  948. return this.mc.supportsIsolationLevel();
  949. }
  950. public boolean supportsQuotedIdentifiers() {
  951. return this.mc.supportsQuotedIdentifiers();
  952. }
  953. public boolean supportsTransactions() {
  954. return this.mc.supportsTransactions();
  955. }
  956. public boolean versionMeetsMinimum(int major, int minor, int subminor)
  957. throws SQLException {
  958. checkClosed();
  959. try {
  960. return this.mc.versionMeetsMinimum(major, minor, subminor);
  961. } catch (SQLException sqlException) {
  962. checkAndFireConnectionError(sqlException);
  963. }
  964. return false;
  965. }
  966. public String exposeAsXml() throws SQLException {
  967. checkClosed();
  968. try {
  969. return this.mc.exposeAsXml();
  970. } catch (SQLException sqlException) {
  971. checkAndFireConnectionError(sqlException);
  972. }
  973. return null;
  974. }
  975. public boolean getAllowLoadLocalInfile() {
  976. return this.mc.getAllowLoadLocalInfile();
  977. }
  978. public boolean getAllowMultiQueries() {
  979. return this.mc.getAllowMultiQueries();
  980. }
  981. public boolean getAllowNanAndInf() {
  982. return this.mc.getAllowNanAndInf();
  983. }
  984. public boolean getAllowUrlInLocalInfile() {
  985. return this.mc.getAllowUrlInLocalInfile();
  986. }
  987. public boolean getAlwaysSendSetIsolation() {
  988. return this.mc.getAlwaysSendSetIsolation();
  989. }
  990. public boolean getAutoClosePStmtStreams() {
  991. return this.mc.getAutoClosePStmtStreams();
  992. }
  993. public boolean getAutoDeserialize() {
  994. return this.mc.getAutoDeserialize();
  995. }
  996. public boolean getAutoGenerateTestcaseScript() {
  997. return this.mc.getAutoGenerateTestcaseScript();
  998. }
  999. public boolean getAutoReconnectForPools() {
  1000. return this.mc.getAutoReconnectForPools();
  1001. }
  1002. public boolean getAutoSlowLog() {
  1003. return this.mc.getAutoSlowLog();
  1004. }
  1005. public int getBlobSendChunkSize() {
  1006. return this.mc.getBlobSendChunkSize();
  1007. }
  1008. public boolean getBlobsAreStrings() {
  1009. return this.mc.getBlobsAreStrings();
  1010. }
  1011. public boolean getCacheCallableStatements() {
  1012. return this.mc.getCacheCallableStatements();
  1013. }
  1014. public boolean getCacheCallableStmts() {
  1015. return this.mc.getCacheCallableStmts();
  1016. }
  1017. public boolean getCachePrepStmts() {
  1018. return this.mc.getCachePrepStmts();
  1019. }
  1020. public boolean getCachePreparedStatements() {
  1021. return this.mc.getCachePreparedStatements();
  1022. }
  1023. public boolean getCacheResultSetMetadata() {
  1024. return this.mc.getCacheResultSetMetadata();
  1025. }
  1026. public boolean getCacheServerConfiguration() {
  1027. return this.mc.getCacheServerConfiguration();
  1028. }
  1029. public int getCallableStatementCacheSize() {
  1030. return this.mc.getCallableStatementCacheSize();
  1031. }
  1032. public int getCallableStmtCacheSize() {
  1033. return this.mc.getCallableStmtCacheSize();
  1034. }
  1035. public boolean getCapitalizeTypeNames() {
  1036. return this.mc.getCapitalizeTypeNames();
  1037. }
  1038. public String getCharacterSetResults() {
  1039. return this.mc.getCharacterSetResults();
  1040. }
  1041. public String getClientCertificateKeyStorePassword() {
  1042. return this.mc.getClientCertificateKeyStorePassword();
  1043. }
  1044. public String getClientCertificateKeyStoreType() {
  1045. return this.mc.getClientCertificateKeyStoreType();
  1046. }
  1047. public String getClientCertificateKeyStoreUrl() {
  1048. return this.mc.getClientCertificateKeyStoreUrl();
  1049. }
  1050. public String getClientInfoProvider() {
  1051. return this.mc.getClientInfoProvider();
  1052. }
  1053. public String getClobCharacterEncoding() {
  1054. return this.mc.getClobCharacterEncoding();
  1055. }
  1056. public boolean getClobberStreamingResults() {
  1057. return this.mc.getClobberStreamingResults();
  1058. }
  1059. public int getConnectTimeout() {
  1060. return this.mc.getConnectTimeout();
  1061. }
  1062. public String getConnectionCollation() {
  1063. return this.mc.getConnectionCollation();
  1064. }
  1065. public String getConnectionLifecycleInterceptors() {
  1066. return this.mc.getConnectionLifecycleInterceptors();
  1067. }
  1068. public boolean getContinueBatchOnError() {
  1069. return this.mc.getContinueBatchOnError();
  1070. }
  1071. public boolean getCreateDatabaseIfNotExist() {
  1072. return this.mc.getCreateDatabaseIfNotExist();
  1073. }
  1074. public int getDefaultFetchSize() {
  1075. return this.mc.getDefaultFetchSize();
  1076. }
  1077. public boolean getDontTrackOpenResources() {
  1078. return this.mc.getDontTrackOpenResources();
  1079. }
  1080. public boolean getDumpMetadataOnColumnNotFound() {
  1081. return this.mc.getDumpMetadataOnColumnNotFound();
  1082. }
  1083. public boolean getDumpQueriesOnException() {
  1084. return this.mc.getDumpQueriesOnException();
  1085. }
  1086. public boolean getDynamicCalendars() {
  1087. return this.mc.getDynamicCalendars();
  1088. }
  1089. public boolean getElideSetAutoCommits() {
  1090. return this.mc.getElideSetAutoCommits();
  1091. }
  1092. public boolean getEmptyStringsConvertToZero() {
  1093. return this.mc.getEmptyStringsConvertToZero();
  1094. }
  1095. public boolean getEmulateLocators() {
  1096. return this.mc.getEmulateLocators();
  1097. }
  1098. public boolean getEmulateUnsupportedPstmts() {
  1099. return this.mc.getEmulateUnsupportedPstmts();
  1100. }
  1101. public boolean getEnablePacketDebug() {
  1102. return this.mc.getEnablePacketDebug();
  1103. }
  1104. public boolean getEnableQueryTimeouts() {
  1105. return this.mc.getEnableQueryTimeouts();
  1106. }
  1107. public String getEncoding() {
  1108. return this.mc.getEncoding();
  1109. }
  1110. public boolean getExplainSlowQueries() {
  1111. return this.mc.getExplainSlowQueries();
  1112. }
  1113. public boolean getFailOverReadOnly() {
  1114. return this.mc.getFailOverReadOnly();
  1115. }
  1116. public boolean getFunctionsNeverReturnBlobs() {
  1117. return this.mc.getFunctionsNeverReturnBlobs();
  1118. }
  1119. public boolean getGatherPerfMetrics() {
  1120. return this.mc.getGatherPerfMetrics();
  1121. }
  1122. public boolean getGatherPerformanceMetrics() {
  1123. return this.mc.getGatherPerformanceMetrics();
  1124. }
  1125. public boolean getGenerateSimpleParameterMetadata() {
  1126. return this.mc.getGenerateSimpleParameterMetadata();
  1127. }
  1128. public boolean getHoldResultsOpenOverStatementClose() {
  1129. return this.mc.getHoldResultsOpenOverStatementClose();
  1130. }
  1131. public boolean getIgnoreNonTxTables() {
  1132. return this.mc.getIgnoreNonTxTables();
  1133. }
  1134. public boolean getIncludeInnodbStatusInDeadlockExceptions() {
  1135. return this.mc.getIncludeInnodbStatusInDeadlockExceptions();
  1136. }
  1137. public int getInitialTimeout() {
  1138. return this.mc.getInitialTimeout();
  1139. }
  1140. public boolean getInteractiveClient() {
  1141. return this.mc.getInteractiveClient();
  1142. }
  1143. public boolean getIsInteractiveClient() {
  1144. return this.mc.getIsInteractiveClient();
  1145. }
  1146. public boolean getJdbcCompliantTruncation() {
  1147. return this.mc.getJdbcCompliantTruncation();
  1148. }
  1149. public boolean getJdbcCompliantTruncationForReads() {
  1150. return this.mc.getJdbcCompliantTruncationForReads();
  1151. }
  1152. public String getLargeRowSizeThreshold() {
  1153. return this.mc.getLargeRowSizeThreshold();
  1154. }
  1155. public String getLoadBalanceStrategy() {
  1156. return this.mc.getLoadBalanceStrategy();
  1157. }
  1158. public String getLocalSocketAddress() {
  1159. return this.mc.getLocalSocketAddress();
  1160. }
  1161. public int getLocatorFetchBufferSize() {
  1162. return this.mc.getLocatorFetchBufferSize();
  1163. }
  1164. public boolean getLogSlowQueries() {
  1165. return this.mc.getLogSlowQueries();
  1166. }
  1167. public boolean getLogXaCommands() {
  1168. return this.mc.getLogXaCommands();
  1169. }
  1170. public String getLogger() {
  1171. return this.mc.getLogger();
  1172. }
  1173. public String getLoggerClassName() {
  1174. return this.mc.getLoggerClassName();
  1175. }
  1176. public boolean getMaintainTimeStats() {
  1177. return this.mc.getMaintainTimeStats();
  1178. }
  1179. public int getMaxQuerySizeToLog() {
  1180. return this.mc.getMaxQuerySizeToLog();
  1181. }
  1182. public int getMaxReconnects() {
  1183. return this.mc.getMaxReconnects();
  1184. }
  1185. public int getMaxRows() {
  1186. return this.mc.getMaxRows();
  1187. }
  1188. public int getMetadataCacheSize() {
  1189. return this.mc.getMetadataCacheSize();
  1190. }
  1191. public int getNetTimeoutForStreamingResults() {
  1192. return this.mc.getNetTimeoutForStreamingResults();
  1193. }
  1194. public boolean getNoAccessToProcedureBodies() {
  1195. return this.mc.getNoAccessToProcedureBodies();
  1196. }
  1197. public boolean getNoDatetimeStringSync() {
  1198. return this.mc.getNoDatetimeStringSync();
  1199. }
  1200. public boolean getNoTimezoneConversionForTimeType() {
  1201. return this.mc.getNoTimezoneConversionForTimeType();
  1202. }
  1203. public boolean getNullCatalogMeansCurrent() {
  1204. return this.mc.getNullCatalogMeansCurrent();
  1205. }
  1206. public boolean getNullNamePatternMatchesAll() {
  1207. return this.mc.getNullNamePatternMatchesAll();
  1208. }
  1209. public boolean getOverrideSupportsIntegrityEnhancementFacility() {
  1210. return this.mc.getOverrideSupportsIntegrityEnhancementFacility();
  1211. }
  1212. public int getPacketDebugBufferSize() {
  1213. return this.mc.getPacketDebugBufferSize();
  1214. }
  1215. public boolean getPadCharsWithSpace() {
  1216. return this.mc.getPadCharsWithSpace();
  1217. }
  1218. public boolean getParanoid() {
  1219. return this.mc.getParanoid();
  1220. }
  1221. public boolean getPedantic() {
  1222. return this.mc.getPedantic();
  1223. }
  1224. public boolean getPinGlobalTxToPhysicalConnection() {
  1225. return this.mc.getPinGlobalTxToPhysicalConnection();
  1226. }
  1227. public boolean getPopulateInsertRowWithDefaultValues() {
  1228. return this.mc.getPopulateInsertRowWithDefaultValues();
  1229. }
  1230. public int getPrepStmtCacheSize() {
  1231. return this.mc.getPrepStmtCacheSize();
  1232. }
  1233. public int getPrepStmtCacheSqlLimit() {
  1234. return this.mc.getPrepStmtCacheSqlLimit();
  1235. }
  1236. public int getPreparedStatementCacheSize() {
  1237. return this.mc.getPreparedStatementCacheSize();
  1238. }
  1239. public int getPreparedStatementCacheSqlLimit() {
  1240. return this.mc.getPreparedStatementCacheSqlLimit();
  1241. }
  1242. public boolean getProcessEscapeCodesForPrepStmts() {
  1243. return this.mc.getProcessEscapeCodesForPrepStmts();
  1244. }
  1245. public boolean getProfileSQL() {
  1246. return this.mc.getProfileSQL();
  1247. }
  1248. public boolean getProfileSql() {
  1249. return this.mc.getProfileSql();
  1250. }
  1251. public String getPropertiesTransform() {
  1252. return this.mc.getPropertiesTransform();
  1253. }
  1254. public int getQueriesBeforeRetryMaster() {
  1255. return this.mc.getQueriesBeforeRetryMaster();
  1256. }
  1257. public boolean getReconnectAtTxEnd() {
  1258. return this.mc.getReconnectAtTxEnd();
  1259. }
  1260. public boolean getRelaxAutoCommit() {
  1261. return this.mc.getRelaxAutoCommit();
  1262. }
  1263. public int getReportMetricsIntervalMillis() {
  1264. return this.mc.getReportMetricsIntervalMillis();
  1265. }
  1266. public boolean getRequireSSL() {
  1267. return this.mc.getRequireSSL();
  1268. }
  1269. public String getResourceId() {
  1270. return this.mc.getResourceId();
  1271. }
  1272. public int getResultSetSizeThreshold() {
  1273. return this.mc.getResultSetSizeThreshold();
  1274. }
  1275. public boolean getRewriteBatchedStatements() {
  1276. return this.mc.getRewriteBatchedStatements();
  1277. }
  1278. public boolean getRollbackOnPooledClose() {
  1279. return this.mc.getRollbackOnPooledClose();
  1280. }
  1281. public boolean getRoundRobinLoadBalance() {
  1282. return this.mc.getRoundRobinLoadBalance();
  1283. }
  1284. public boolean getRunningCTS13() {
  1285. return this.mc.getRunningCTS13();
  1286. }
  1287. public int getSecondsBeforeRetryMaster() {
  1288. return this.mc.getSecondsBeforeRetryMaster();
  1289. }
  1290. public String getServerTimezone() {
  1291. return this.mc.getServerTimezone();
  1292. }
  1293. public String getSessionVariables() {
  1294. return this.mc.getSessionVariables();
  1295. }
  1296. public int getSlowQueryThresholdMillis() {
  1297. return this.mc.getSlowQueryThresholdMillis();
  1298. }
  1299. public long getSlowQueryThresholdNanos() {
  1300. return this.mc.getSlowQueryThresholdNanos();
  1301. }
  1302. public String getSocketFactory() {
  1303. return this.mc.getSocketFactory();
  1304. }
  1305. public String getSocketFactoryClassName() {
  1306. return this.mc.getSocketFactoryClassName();
  1307. }
  1308. public int getSocketTimeout() {
  1309. return this.mc.getSocketTimeout();
  1310. }
  1311. public String getStatementInterceptors() {
  1312. return this.mc.getStatementInterceptors();
  1313. }
  1314. public boolean getStrictFloatingPoint() {
  1315. return this.mc.getStrictFloatingPoint();
  1316. }
  1317. public boolean getStrictUpdates() {
  1318. return this.mc.getStrictUpdates();
  1319. }
  1320. public boolean getTcpKeepAlive() {
  1321. return this.mc.getTcpKeepAlive();
  1322. }
  1323. public boolean getTcpNoDelay() {
  1324. return this.mc.getTcpNoDelay();
  1325. }
  1326. public int getTcpRcvBuf() {
  1327. return this.mc.getTcpRcvBuf();
  1328. }
  1329. public int getTcpSndBuf() {
  1330. return this.mc.getTcpSndBuf();
  1331. }
  1332. public int getTcpTrafficClass() {
  1333. return this.mc.getTcpTrafficClass();
  1334. }
  1335. public boolean getTinyInt1isBit() {
  1336. return this.mc.getTinyInt1isBit();
  1337. }
  1338. public boolean getTraceProtocol() {
  1339. return this.mc.getTraceProtocol();
  1340. }
  1341. public boolean getTransformedBitIsBoolean() {
  1342. return this.mc.getTransformedBitIsBoolean();
  1343. }
  1344. public boolean getTreatUtilDateAsTimestamp() {
  1345. return this.mc.getTreatUtilDateAsTimestamp();
  1346. }
  1347. public String getTrustCertificateKeyStorePassword() {
  1348. return this.mc.getTrustCertificateKeyStorePassword();
  1349. }
  1350. public String getTrustCertificateKeyStoreType() {
  1351. return this.mc.getTrustCertificateKeyStoreType();
  1352. }
  1353. public String getTrustCertificateKeyStoreUrl() {
  1354. return this.mc.getTrustCertificateKeyStoreUrl();
  1355. }
  1356. public boolean getUltraDevHack() {
  1357. return this.mc.getUltraDevHack();
  1358. }
  1359. public boolean getUseBlobToStoreUTF8OutsideBMP() {
  1360. return this.mc.getUseBlobToStoreUTF8OutsideBMP();
  1361. }
  1362. public boolean getUseCompression() {
  1363. return this.mc.getUseCompression();
  1364. }
  1365. public String getUseConfigs() {
  1366. return this.mc.getUseConfigs();
  1367. }
  1368. public boolean getUseCursorFetch() {
  1369. return this.mc.getUseCursorFetch();
  1370. }
  1371. public boolean getUseDirectRowUnpack() {
  1372. return this.mc.getUseDirectRowUnpack();
  1373. }
  1374. public boolean getUseDynamicCharsetInfo() {
  1375. return this.mc.getUseDynamicCharsetInfo();
  1376. }
  1377. public boolean getUseFastDateParsing() {
  1378. return this.mc.getUseFastDateParsing();
  1379. }
  1380. public boolean getUseFastIntParsing() {
  1381. return this.mc.getUseFastIntParsing();
  1382. }
  1383. public boolean getUseGmtMillisForDatetimes() {
  1384. return this.mc.getUseGmtMillisForDatetimes();
  1385. }
  1386. public boolean getUseHostsInPrivileges() {
  1387. return this.mc.getUseHostsInPrivileges();
  1388. }
  1389. public boolean getUseInformationSchema() {
  1390. return this.mc.getUseInformationSchema();
  1391. }
  1392. public boolean getUseJDBCCompliantTimezoneShift() {
  1393. return this.mc.getUseJDBCCompliantTimezoneShift();
  1394. }
  1395. public boolean getUseJvmCharsetConverters() {
  1396. return this.mc.getUseJvmCharsetConverters();
  1397. }
  1398. public boolean getUseLocalSessionState() {
  1399. return this.mc.getUseLocalSessionState();
  1400. }
  1401. public boolean getUseNanosForElapsedTime() {
  1402. return this.mc.getUseNanosForElapsedTime();
  1403. }
  1404. public boolean getUseOldAliasMetadataBehavior() {
  1405. return this.mc.getUseOldAliasMetadataBehavior();
  1406. }
  1407. public boolean getUseOldUTF8Behavior() {
  1408. return this.mc.getUseOldUTF8Behavior();
  1409. }
  1410. public boolean getUseOnlyServerErrorMessages() {
  1411. return this.mc.getUseOnlyServerErrorMessages();
  1412. }
  1413. public boolean getUseReadAheadInput() {
  1414. return this.mc.getUseReadAheadInput();
  1415. }
  1416. public boolean getUseSSL() {
  1417. return this.mc.getUseSSL();
  1418. }
  1419. public boolean getUseSSPSCompatibleTimezoneShift() {
  1420. return this.mc.getUseSSPSCompatibleTimezoneShift();
  1421. }
  1422. public boolean getUseServerPrepStmts() {
  1423. return this.mc.getUseServerPrepStmts();
  1424. }
  1425. public boolean getUseServerPreparedStmts() {
  1426. return this.mc.getUseServerPreparedStmts();
  1427. }
  1428. public boolean getUseSqlStateCodes() {
  1429. return this.mc.getUseSqlStateCodes();
  1430. }
  1431. public boolean getUseStreamLengthsInPrepStmts() {
  1432. return this.mc.getUseStreamLengthsInPrepStmts();
  1433. }
  1434. public boolean getUseTimezone() {
  1435. return this.mc.getUseTimezone();
  1436. }
  1437. public boolean getUseUltraDevWorkAround() {
  1438. return this.mc.getUseUltraDevWorkAround();
  1439. }
  1440. public boolean getUseUnbufferedInput() {
  1441. return this.mc.getUseUnbufferedInput();
  1442. }
  1443. public boolean getUseUnicode() {
  1444. return this.mc.getUseUnicode();
  1445. }
  1446. public boolean getUseUsageAdvisor() {
  1447. return this.mc.getUseUsageAdvisor();
  1448. }
  1449. public String getUtf8OutsideBmpExcludedColumnNamePattern() {
  1450. return this.mc.getUtf8OutsideBmpExcludedColumnNamePattern();
  1451. }
  1452. public String getUtf8OutsideBmpIncludedColumnNamePattern() {
  1453. return this.mc.getUtf8OutsideBmpIncludedColumnNamePattern();
  1454. }
  1455. public boolean getYearIsDateType() {
  1456. return this.mc.getYearIsDateType();
  1457. }
  1458. public String getZeroDateTimeBehavior() {
  1459. return this.mc.getZeroDateTimeBehavior();
  1460. }
  1461. public void setAllowLoadLocalInfile(boolean property) {
  1462. this.mc.setAllowLoadLocalInfile(property);
  1463. }
  1464. public void setAllowMultiQueries(boolean property) {
  1465. this.mc.setAllowMultiQueries(property);
  1466. }
  1467. public void setAllowNanAndInf(boolean flag) {
  1468. this.mc.setAllowNanAndInf(flag);
  1469. }
  1470. public void setAllowUrlInLocalInfile(boolean flag) {
  1471. this.mc.setAllowUrlInLocalInfile(flag);
  1472. }
  1473. public void setAlwaysSendSetIsolation(boolean flag) {
  1474. this.mc.setAlwaysSendSetIsolation(flag);
  1475. }
  1476. public void setAutoClosePStmtStreams(boolean flag) {
  1477. this.mc.setAutoClosePStmtStreams(flag);
  1478. }
  1479. public void setAutoDeserialize(boolean flag) {
  1480. this.mc.setAutoDeserialize(flag);
  1481. }
  1482. public void setAutoGenerateTestcaseScript(boolean flag) {
  1483. this.mc.setAutoGenerateTestcaseScript(flag);
  1484. }
  1485. public void setAutoReconnect(boolean flag) {
  1486. this.mc.setAutoReconnect(flag);
  1487. }
  1488. public void setAutoReconnectForConnectionPools(boolean property) {
  1489. this.mc.setAutoReconnectForConnectionPools(property);
  1490. }
  1491. public void setAutoReconnectForPools(boolean flag) {
  1492. this.mc.setAutoReconnectForPools(flag);
  1493. }
  1494. public void setAutoSlowLog(boolean flag) {
  1495. this.mc.setAutoSlowLog(flag);
  1496. }
  1497. public void setBlobSendChunkSize(String value) throws SQLException {
  1498. this.mc.setBlobSendChunkSize(value);
  1499. }
  1500. public void setBlobsAreStrings(boolean flag) {
  1501. this.mc.setBlobsAreStrings(flag);
  1502. }
  1503. public void setCacheCallableStatements(boolean flag) {
  1504. this.mc.setCacheCallableStatements(flag);
  1505. }
  1506. public void setCacheCallableStmts(boolean flag) {
  1507. this.mc.setCacheCallableStmts(flag);
  1508. }
  1509. public void setCachePrepStmts(boolean flag) {
  1510. this.mc.setCachePrepStmts(flag);
  1511. }
  1512. public void setCachePreparedStatements(boolean flag) {
  1513. this.mc.setCachePreparedStatements(flag);
  1514. }
  1515. public void setCacheResultSetMetadata(boolean property) {
  1516. this.mc.setCacheResultSetMetadata(property);
  1517. }
  1518. public void setCacheServerConfiguration(boolean flag) {
  1519. this.mc.setCacheServerConfiguration(flag);
  1520. }
  1521. public void setCallableStatementCacheSize(int size) {
  1522. this.mc.setCallableStatementCacheSize(size);
  1523. }
  1524. public void setCallableStmtCacheSize(int cacheSize) {
  1525. this.mc.setCallableStmtCacheSize(cacheSize);
  1526. }
  1527. public void setCapitalizeDBMDTypes(boolean property) {
  1528. this.mc.setCapitalizeDBMDTypes(property);
  1529. }
  1530. public void setCapitalizeTypeNames(boolean flag) {
  1531. this.mc.setCapitalizeTypeNames(flag);
  1532. }
  1533. public void setCharacterEncoding(String encoding) {
  1534. this.mc.setCharacterEncoding(encoding);
  1535. }
  1536. public void setCharacterSetResults(String characterSet) {
  1537. this.mc.setCharacterSetResults(characterSet);
  1538. }
  1539. public void setClientCertificateKeyStorePassword(String value) {
  1540. this.mc.setClientCertificateKeyStorePassword(value);
  1541. }
  1542. public void setClientCertificateKeyStoreType(String value) {
  1543. this.mc.setClientCertificateKeyStoreType(value);
  1544. }
  1545. public void setClientCertificateKeyStoreUrl(String value) {
  1546. this.mc.setClientCertificateKeyStoreUrl(value);
  1547. }
  1548. public void setClientInfoProvider(String classname) {
  1549. this.mc.setClientInfoProvider(classname);
  1550. }
  1551. public void setClobCharacterEncoding(String encoding) {
  1552. this.mc