org.apache.commons.dbutils.QueryRunner.prepareStatement()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(77)

本文整理了Java中org.apache.commons.dbutils.QueryRunner.prepareStatement方法的一些代码示例,展示了QueryRunner.prepareStatement的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryRunner.prepareStatement方法的具体详情如下:
包路径:org.apache.commons.dbutils.QueryRunner
类名称:QueryRunner
方法名:prepareStatement

QueryRunner.prepareStatement介绍

暂无

代码示例

代码示例来源:origin: com.github.endoscope/storage-jdbc

@Override
protected PreparedStatement prepareStatement(Connection conn, String sql) throws SQLException {
  PreparedStatement ps = super.prepareStatement(conn, sql);
  applyFetchSize(ps);
  return ps;
}

代码示例来源:origin: com.github.endoscope/endoscope-storage-jdbc

@Override
protected PreparedStatement prepareStatement(Connection conn, String sql, int returnedKeys) throws SQLException {
  PreparedStatement ps = super.prepareStatement(conn, sql, returnedKeys);
  applyFetchSize(ps);
  return ps;
}

代码示例来源:origin: com.github.endoscope/endoscope-storage-jdbc

@Override
protected PreparedStatement prepareStatement(Connection conn, String sql) throws SQLException {
  PreparedStatement ps = super.prepareStatement(conn, sql);
  applyFetchSize(ps);
  return ps;
}

代码示例来源:origin: com.github.endoscope/storage-jdbc

@Override
protected PreparedStatement prepareStatement(Connection conn, String sql, int returnedKeys) throws SQLException {
  PreparedStatement ps = super.prepareStatement(conn, sql, returnedKeys);
  applyFetchSize(ps);
  return ps;
}

代码示例来源:origin: drinkjava2/jSqlBox

@Override
protected PreparedStatement prepareStatement(Connection conn, String sql) throws SQLException {
  if (this.getAllowShowSQL() && !batchEnabled.get())
    logger.info(formatSqlForLoggerOutput(sql));
  return super.prepareStatement(conn, sql);
}

代码示例来源:origin: commons-dbutils/commons-dbutils

int[] rows = null;
try {
  stmt = this.prepareStatement(conn, sql);

代码示例来源:origin: commons-dbutils/commons-dbutils

stmt = this.prepareStatement(conn, sql);
this.fillStatement(stmt, params);
rows = stmt.executeUpdate();

代码示例来源:origin: commons-dbutils/commons-dbutils

@Test
public void testStatementConfiguration() throws Exception {
  StatementConfiguration stmtConfig = new StatementConfiguration(1, 2, 3, 4, 5);
  QueryRunner queryRunner = new QueryRunner(stmtConfig);
  queryRunner.prepareStatement(conn, "select 1");
  verify(stmt).setFetchDirection(eq(1));
  verify(stmt).setFetchSize(eq(2));
  verify(stmt).setMaxFieldSize(eq(3));
  verify(stmt).setMaxRows(eq(4));
  verify(stmt).setQueryTimeout(eq(5));
}

代码示例来源:origin: commons-dbutils/commons-dbutils

T generatedKeys = null;
try {
  stmt = this.prepareStatement(conn, sql, Statement.RETURN_GENERATED_KEYS);

代码示例来源:origin: commons-dbutils/commons-dbutils

stmt = this.prepareStatement(conn, sql);
this.fillStatement(stmt, params);
rs = this.wrap(stmt.executeQuery());

相关文章