Package com.j256.ormlite.support

Examples of com.j256.ormlite.support.CompiledStatement.runExecute()


    }
    CompiledStatement compiledStatement =
        connection.compileStatement(statement, StatementType.EXECUTE, noFieldTypes);
    try {
      assignStatementArguments(compiledStatement, arguments);
      return compiledStatement.runExecute();
    } finally {
      compiledStatement.close();
    }
  }
View Full Code Here


    String statement = sb.toString();
    logger.info("clearing table '{}' with '{}", tableName, statement);
    CompiledStatement compiledStmt = null;
    try {
      compiledStmt = connection.compileStatement(statement, StatementType.EXECUTE, noFieldTypes);
      return compiledStmt.runExecute();
    } finally {
      if (compiledStmt != null) {
        compiledStmt.close();
      }
      connectionSource.releaseConnection(connection);
View Full Code Here

    DatabaseConnection connection = connectionSource.getReadWriteConnection();
    try {
      compiledStmt =
          connection.compileStatement(statement, StatementType.EXECUTE, noFieldTypes,
              DatabaseConnection.DEFAULT_RESULT_FLAGS);
      return compiledStmt.runExecute();
    } finally {
      IOUtils.closeThrowSqlException(compiledStmt, "compiled statement");
      connectionSource.releaseConnection(connection);
    }
  }
View Full Code Here

      CompiledStatement compiledStmt = null;
      try {
        compiledStmt =
            connection.compileStatement(statement, StatementType.EXECUTE, noFieldTypes,
                DatabaseConnection.DEFAULT_RESULT_FLAGS);
        rowC = compiledStmt.runExecute();
        logger.info("executed {} table statement changed {} rows: {}", label, rowC, statement);
      } catch (SQLException e) {
        if (ignoreErrors) {
          logger.info("ignoring {} error '{}' for statement: {}", label, e, statement);
        } else {
View Full Code Here

            assertEquals(0, ((FieldType[]) args[2]).length);
            return stmt;
          }
        })
        .anyTimes();
    expect(stmt.runExecute()).andReturn(0).anyTimes();
    connectionSource.releaseConnection(conn);
    expect(connectionSource.getReadWriteConnection()).andReturn(conn);
    connectionSource.releaseConnection(conn);
    expectLastCall().anyTimes();
    stmt.close();
View Full Code Here

            assertEquals(0, ((FieldType[]) args[2]).length);
            return stmt;
          }
        })
        .anyTimes();
    expect(stmt.runExecute()).andReturn(0).anyTimes();
    connectionSource.releaseConnection(conn);
    expect(connectionSource.getReadWriteConnection()).andReturn(conn);
    connectionSource.releaseConnection(conn);
    expectLastCall().anyTimes();
    stmt.close();
View Full Code Here

            assertEquals(StatementType.EXECUTE, args[1]);
            assertEquals(0, ((FieldType[]) args[2]).length);
            return stmt;
          }
        }).anyTimes();
    expect(stmt.runExecute()).andReturn(0).anyTimes();
    connectionSource.releaseConnection(conn);
    expect(connectionSource.getReadWriteConnection()).andReturn(conn);
    connectionSource.releaseConnection(conn);
    expectLastCall().anyTimes();
    stmt.close();
View Full Code Here

      expect(conn.compileStatement(isA(String.class), isA(StatementType.class), isA(FieldType[].class), anyInt())).andThrow(
          new SQLException("you asked us to!!"));
    } else {
      expect(conn.compileStatement(isA(String.class), isA(StatementType.class), isA(FieldType[].class), anyInt())).andReturn(
          stmt);
      expect(stmt.runExecute()).andReturn(rowN);
      stmt.close();
      if (queryAfter != null) {
        expect(
            conn.compileStatement(isA(String.class), isA(StatementType.class), isA(FieldType[].class),
                anyInt())).andReturn(stmt);
View Full Code Here

    CompiledStatement compiledStatement =
        connection.compileStatement(statement, StatementType.EXECUTE, noFieldTypes,
            DatabaseConnection.DEFAULT_RESULT_FLAGS);
    try {
      assignStatementArguments(compiledStatement, arguments);
      return compiledStatement.runExecute();
    } finally {
      IOUtils.closeThrowSqlException(compiledStatement, "compiled statement");
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.