PageRenderTime 45ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 1ms

/testdata/mysql/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java

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