PageRenderTime 59ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/EQEmuJSM/mysql-connector-java-5.1.13/src/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java

http://cubbers-eqemu-utils.googlecode.com/
Java | 2551 lines | 1754 code | 533 blank | 264 comment | 23 complexity | 6f3a73e79a7281eadd58cbac6d369113 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, Apache-2.0

Large files files are truncated, but you can click here to view the full file

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

Large files files are truncated, but you can click here to view the full file