本文整理汇总了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));
}
示例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));
}
}
示例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
}
示例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
}
示例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
}
示例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;
}
示例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);
}
}