当前位置: 首页>>代码示例>>Java>>正文


Java StatementImpl类代码示例

本文整理汇总了Java中com.mysql.jdbc.StatementImpl的典型用法代码示例。如果您正苦于以下问题:Java StatementImpl类的具体用法?Java StatementImpl怎么用?Java StatementImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


StatementImpl类属于com.mysql.jdbc包,在下文中一共展示了StatementImpl类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testIsJdbcInterface

import com.mysql.jdbc.StatementImpl; //导入依赖的package包/类
/**
 * Tests Util.isJdbcInterface()
 * 
 * @throws Exception
 */
public void testIsJdbcInterface() throws Exception {
    // Classes directly or indirectly implementing JDBC interfaces.
    assertTrue(Util.isJdbcInterface(PreparedStatement.class));
    assertTrue(Util.isJdbcInterface(StatementImpl.class));
    assertTrue(Util.isJdbcInterface(Statement.class));
    assertTrue(Util.isJdbcInterface(ResultSetImpl.class));
    Statement s = (Statement) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class<?>[] { Statement.class }, new InvocationHandler() {
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            return null;
        }
    });
    assertTrue(Util.isJdbcInterface(s.getClass()));

    // Classes not implementing JDBC interfaces.
    assertFalse(Util.isJdbcInterface(Util.class));
    assertFalse(Util.isJdbcInterface(UtilsTest.class));

}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:24,代码来源:UtilsTest.java

示例2: testGetImplementedInterfaces

import com.mysql.jdbc.StatementImpl; //导入依赖的package包/类
/**
 * Tests Util.isJdbcPackage()
 * 
 * @throws Exception
 */
public void testGetImplementedInterfaces() throws Exception {
    Class<?>[] ifaces;
    ifaces = Util.getImplementedInterfaces(Statement.class);
    assertEquals(1, ifaces.length);
    assertEquals(ifaces[0], java.sql.Statement.class);

    ifaces = Util.getImplementedInterfaces(StatementImpl.class);
    assertEquals(1, ifaces.length);
    assertEquals(ifaces[0], Statement.class);

    ifaces = Util.getImplementedInterfaces(ConnectionImpl.class);
    assertEquals(3, ifaces.length);
    List<Class<?>> ifacesList = Arrays.asList(ifaces);
    for (Class<?> clazz : new Class<?>[] { MySQLConnection.class, Serializable.class, ConnectionProperties.class }) {
        assertTrue(ifacesList.contains(clazz));
    }
}
 
开发者ID:mniepert,项目名称:TPKB,代码行数:23,代码来源:UtilsTest.java

示例3: executeLargeBatch

import com.mysql.jdbc.StatementImpl; //导入依赖的package包/类
/**
 * JDBC 4.2
 * Same as {@link #executeBatch()} but returns long[] instead of int[].
 */
public long[] executeLargeBatch() throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return ((StatementImpl) this.wrappedStmt).executeLargeBatch();
        }

        throw SQLError.createSQLException("Statement already closed", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return null; // we actually never get here, but the compiler can't figure that out
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:18,代码来源:StatementWrapper.java

示例4: executeLargeUpdate

import com.mysql.jdbc.StatementImpl; //导入依赖的package包/类
/**
 * JDBC 4.2
 * Same as {@link #executeUpdate(String)} but returns long instead of int.
 */
public long executeLargeUpdate(String sql) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return ((StatementImpl) this.wrappedStmt).executeLargeUpdate(sql);
        }

        throw SQLError.createSQLException("Statement already closed", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return -1; // we actually never get here, but the compiler can't figure that out
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:18,代码来源:StatementWrapper.java

示例5: getLargeMaxRows

import com.mysql.jdbc.StatementImpl; //导入依赖的package包/类
/**
 * JDBC 4.2
 * Same as {@link #getMaxRows()} but returns long instead of int.
 */
public long getLargeMaxRows() throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return ((StatementImpl) this.wrappedStmt).getLargeMaxRows();
        }

        throw SQLError.createSQLException("Statement already closed", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return 0; // we actually never get here, but the compiler can't figure that out
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:18,代码来源:StatementWrapper.java

示例6: getLargeUpdateCount

import com.mysql.jdbc.StatementImpl; //导入依赖的package包/类
/**
 * JDBC 4.2
 * Same as {@link #getUpdateCount()} but returns long instead of int;
 */
public long getLargeUpdateCount() throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return ((StatementImpl) this.wrappedStmt).getLargeUpdateCount();
        }

        throw SQLError.createSQLException("Statement already closed", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return -1;
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:18,代码来源:StatementWrapper.java

示例7: setLargeMaxRows

import com.mysql.jdbc.StatementImpl; //导入依赖的package包/类
/**
 * JDBC 4.2
 * Same as {@link #setMaxRows(int)} but accepts a long value instead of an int.
 */
public void setLargeMaxRows(long max) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((StatementImpl) this.wrappedStmt).setLargeMaxRows(max);
        } else {
            throw SQLError.createSQLException("Statement already closed", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:16,代码来源:StatementWrapper.java


注:本文中的com.mysql.jdbc.StatementImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。