Java Code Examples for com.mysql.jdbc.Util#handleNewInstance()

The following examples show how to use com.mysql.jdbc.Util#handleNewInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SuspendableXAConnection.java    From r-course with MIT License 5 votes vote down vote up
protected static SuspendableXAConnection getInstance(Connection mysqlConnection) throws SQLException {
    if (!Util.isJdbc4()) {
        return new SuspendableXAConnection(mysqlConnection);
    }

    return (SuspendableXAConnection) Util.handleNewInstance(JDBC_4_XA_CONNECTION_WRAPPER_CTOR, new Object[] { mysqlConnection },
            mysqlConnection.getExceptionInterceptor());
}
 
Example 2
Source File: MysqlXAConnection.java    From r-course with MIT License 5 votes vote down vote up
protected static MysqlXAConnection getInstance(com.mysql.jdbc.Connection mysqlConnection, boolean logXaCommands) throws SQLException {
    if (!Util.isJdbc4()) {
        return new MysqlXAConnection(mysqlConnection, logXaCommands);
    }

    return (MysqlXAConnection) Util.handleNewInstance(JDBC_4_XA_CONNECTION_WRAPPER_CTOR, new Object[] { mysqlConnection, Boolean.valueOf(logXaCommands) },
            mysqlConnection.getExceptionInterceptor());
}
 
Example 3
Source File: PreparedStatementWrapper.java    From r-course with MIT License 5 votes vote down vote up
protected static PreparedStatementWrapper getInstance(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) throws SQLException {
    if (!Util.isJdbc4()) {
        return new PreparedStatementWrapper(c, conn, toWrap);
    }

    return (PreparedStatementWrapper) Util.handleNewInstance(JDBC_4_PREPARED_STATEMENT_WRAPPER_CTOR, new Object[] { c, conn, toWrap },
            conn.getExceptionInterceptor());
}
 
Example 4
Source File: CallableStatementWrapper.java    From r-course with MIT License 5 votes vote down vote up
protected static CallableStatementWrapper getInstance(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) throws SQLException {
    if (!Util.isJdbc4()) {
        return new CallableStatementWrapper(c, conn, toWrap);
    }

    return (CallableStatementWrapper) Util.handleNewInstance(JDBC_4_CALLABLE_STATEMENT_WRAPPER_CTOR, new Object[] { c, conn, toWrap },
            conn.getExceptionInterceptor());
}
 
Example 5
Source File: StatementWrapper.java    From r-course with MIT License 5 votes vote down vote up
protected static StatementWrapper getInstance(ConnectionWrapper c, MysqlPooledConnection conn, Statement toWrap) throws SQLException {
    if (!Util.isJdbc4()) {
        return new StatementWrapper(c, conn, toWrap);
    }

    return (StatementWrapper) Util.handleNewInstance(JDBC_4_STATEMENT_WRAPPER_CTOR, new Object[] { c, conn, toWrap }, conn.getExceptionInterceptor());
}
 
Example 6
Source File: MysqlPooledConnection.java    From r-course with MIT License 5 votes vote down vote up
protected static MysqlPooledConnection getInstance(com.mysql.jdbc.Connection connection) throws SQLException {
    if (!Util.isJdbc4()) {
        return new MysqlPooledConnection(connection);
    }

    return (MysqlPooledConnection) Util.handleNewInstance(JDBC_4_POOLED_CONNECTION_WRAPPER_CTOR, new Object[] { connection },
            connection.getExceptionInterceptor());
}
 
Example 7
Source File: ConnectionWrapper.java    From r-course with MIT License 5 votes vote down vote up
protected static ConnectionWrapper getInstance(MysqlPooledConnection mysqlPooledConnection, Connection mysqlConnection, boolean forXa) throws SQLException {
    if (!Util.isJdbc4()) {
        return new ConnectionWrapper(mysqlPooledConnection, mysqlConnection, forXa);
    }

    return (ConnectionWrapper) Util.handleNewInstance(JDBC_4_CONNECTION_WRAPPER_CTOR,
            new Object[] { mysqlPooledConnection, mysqlConnection, Boolean.valueOf(forXa) }, mysqlPooledConnection.getExceptionInterceptor());
}
 
Example 8
Source File: SuspendableXAConnection.java    From Komondor with GNU General Public License v3.0 5 votes vote down vote up
protected static SuspendableXAConnection getInstance(Connection mysqlConnection) throws SQLException {
    if (!Util.isJdbc4()) {
        return new SuspendableXAConnection(mysqlConnection);
    }

    return (SuspendableXAConnection) Util.handleNewInstance(JDBC_4_XA_CONNECTION_WRAPPER_CTOR, new Object[] { mysqlConnection },
            mysqlConnection.getExceptionInterceptor());
}
 
Example 9
Source File: MysqlXAConnection.java    From Komondor with GNU General Public License v3.0 5 votes vote down vote up
protected static MysqlXAConnection getInstance(com.mysql.jdbc.Connection mysqlConnection, boolean logXaCommands) throws SQLException {
    if (!Util.isJdbc4()) {
        return new MysqlXAConnection(mysqlConnection, logXaCommands);
    }

    return (MysqlXAConnection) Util.handleNewInstance(JDBC_4_XA_CONNECTION_WRAPPER_CTOR, new Object[] { mysqlConnection, Boolean.valueOf(logXaCommands) },
            mysqlConnection.getExceptionInterceptor());
}
 
Example 10
Source File: PreparedStatementWrapper.java    From Komondor with GNU General Public License v3.0 5 votes vote down vote up
protected static PreparedStatementWrapper getInstance(ConnectionWrapper c, MysqlPooledConnection conn, PreparedStatement toWrap) throws SQLException {
    if (!Util.isJdbc4()) {
        return new PreparedStatementWrapper(c, conn, toWrap);
    }

    return (PreparedStatementWrapper) Util.handleNewInstance(JDBC_4_PREPARED_STATEMENT_WRAPPER_CTOR, new Object[] { c, conn, toWrap },
            conn.getExceptionInterceptor());
}
 
Example 11
Source File: CallableStatementWrapper.java    From Komondor with GNU General Public License v3.0 5 votes vote down vote up
protected static CallableStatementWrapper getInstance(ConnectionWrapper c, MysqlPooledConnection conn, CallableStatement toWrap) throws SQLException {
    if (!Util.isJdbc4()) {
        return new CallableStatementWrapper(c, conn, toWrap);
    }

    return (CallableStatementWrapper) Util.handleNewInstance(JDBC_4_CALLABLE_STATEMENT_WRAPPER_CTOR, new Object[] { c, conn, toWrap },
            conn.getExceptionInterceptor());
}
 
Example 12
Source File: StatementWrapper.java    From Komondor with GNU General Public License v3.0 5 votes vote down vote up
protected static StatementWrapper getInstance(ConnectionWrapper c, MysqlPooledConnection conn, Statement toWrap) throws SQLException {
    if (!Util.isJdbc4()) {
        return new StatementWrapper(c, conn, toWrap);
    }

    return (StatementWrapper) Util.handleNewInstance(JDBC_4_STATEMENT_WRAPPER_CTOR, new Object[] { c, conn, toWrap }, conn.getExceptionInterceptor());
}
 
Example 13
Source File: MysqlPooledConnection.java    From Komondor with GNU General Public License v3.0 5 votes vote down vote up
protected static MysqlPooledConnection getInstance(com.mysql.jdbc.Connection connection) throws SQLException {
    if (!Util.isJdbc4()) {
        return new MysqlPooledConnection(connection);
    }

    return (MysqlPooledConnection) Util.handleNewInstance(JDBC_4_POOLED_CONNECTION_WRAPPER_CTOR, new Object[] { connection },
            connection.getExceptionInterceptor());
}
 
Example 14
Source File: ConnectionWrapper.java    From Komondor with GNU General Public License v3.0 5 votes vote down vote up
protected static ConnectionWrapper getInstance(MysqlPooledConnection mysqlPooledConnection, Connection mysqlConnection, boolean forXa) throws SQLException {
    if (!Util.isJdbc4()) {
        return new ConnectionWrapper(mysqlPooledConnection, mysqlConnection, forXa);
    }

    return (ConnectionWrapper) Util.handleNewInstance(JDBC_4_CONNECTION_WRAPPER_CTOR,
            new Object[] { mysqlPooledConnection, mysqlConnection, Boolean.valueOf(forXa) }, mysqlPooledConnection.getExceptionInterceptor());
}