Examples of compileStatement()


Examples of com.j256.ormlite.support.DatabaseConnection.compileStatement()

   */
  public RawResults queryForAllRawOld(ConnectionSource connectionSource, String query) throws SQLException {
    DatabaseConnection connection = connectionSource.getReadOnlyConnection();
    CompiledStatement compiledStatement = null;
    try {
      compiledStatement = connection.compileStatement(query, StatementType.SELECT, noFieldTypes);
      String[] columnNames = extractColumnNames(compiledStatement);
      RawResultsWrapper rawResults =
          new RawResultsWrapper(connectionSource, connection, query, compiledStatement, columnNames, this);
      compiledStatement = null;
      connection = null;
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection.compileStatement()

  public RawResults buildOldIterator(ConnectionSource connectionSource, String query) throws SQLException {
    logger.debug("executing raw results iterator for: {}", query);
    DatabaseConnection connection = connectionSource.getReadOnlyConnection();
    CompiledStatement compiledStatement = null;
    try {
      compiledStatement = connection.compileStatement(query, StatementType.SELECT, noFieldTypes);
      String[] columnNames = extractColumnNames(compiledStatement);
      RawResultsWrapper rawResults =
          new RawResultsWrapper(connectionSource, connection, query, compiledStatement, columnNames, this);
      compiledStatement = null;
      connection = null;
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection.compileStatement()

      logger.trace("query arguments: {}", (Object) arguments);
    }
    DatabaseConnection connection = connectionSource.getReadOnlyConnection();
    CompiledStatement compiledStatement = null;
    try {
      compiledStatement = connection.compileStatement(query, StatementType.SELECT, noFieldTypes);
      assignStatementArguments(compiledStatement, arguments);
      String[] columnNames = extractColumnNames(compiledStatement);
      GenericRawResults<String[]> rawResults =
          new RawResultsImpl<String[]>(connectionSource, connection, query, String[].class,
              compiledStatement, columnNames, this);
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection.compileStatement()

      logger.trace("query arguments: {}", (Object) arguments);
    }
    DatabaseConnection connection = connectionSource.getReadOnlyConnection();
    CompiledStatement compiledStatement = null;
    try {
      compiledStatement = connection.compileStatement(query, StatementType.SELECT, noFieldTypes);
      assignStatementArguments(compiledStatement, arguments);
      String[] columnNames = extractColumnNames(compiledStatement);
      RawResultsImpl<UO> rawResults =
          new RawResultsImpl<UO>(connectionSource, connection, query, String[].class, compiledStatement,
              columnNames, new UserObjectRowMapper<UO>(rowMapper, columnNames, this));
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection.compileStatement()

      logger.trace("query arguments: {}", (Object) arguments);
    }
    DatabaseConnection connection = connectionSource.getReadOnlyConnection();
    CompiledStatement compiledStatement = null;
    try {
      compiledStatement = connection.compileStatement(query, StatementType.SELECT, noFieldTypes);
      assignStatementArguments(compiledStatement, arguments);
      String[] columnNames = extractColumnNames(compiledStatement);
      RawResultsImpl<Object[]> rawResults =
          new RawResultsImpl<Object[]>(connectionSource, connection, query, Object[].class,
              compiledStatement, columnNames, new ObjectArrayRowMapper(columnTypes));
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection.compileStatement()

    databaseType.appendEscapedEntityName(sb, tableName);
    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();
      }
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection.compileStatement()

    foo.string = "not a date format";
    assertEquals(1, dao.create(foo));
    DatabaseConnection conn = connectionSource.getReadOnlyConnection();
    CompiledStatement stmt = null;
    try {
      stmt = conn.compileStatement("select * from " + TABLE_NAME, StatementType.SELECT, noFieldTypes);
      DatabaseResults results = stmt.runQuery();
      assertTrue(results.next());
      int colNum = results.findColumn(STRING_COLUMN);
      DataType.DATE_STRING.getDataPersister().resultToJava(null, results, colNum);
    } finally {
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection.compileStatement()

    foo.string = "not a date format";
    assertEquals(1, dao.create(foo));
    DatabaseConnection conn = connectionSource.getReadOnlyConnection();
    CompiledStatement stmt = null;
    try {
      stmt = conn.compileStatement("select * from " + TABLE_NAME, StatementType.SELECT, noFieldTypes);
      DatabaseResults results = stmt.runQuery();
      assertTrue(results.next());
      int colNum = results.findColumn(STRING_COLUMN);
      DataType.JAVA_DATE_STRING.getDataPersister().resultToJava(null, results, colNum);
    } finally {
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection.compileStatement()

    foo.serializable = null;
    assertEquals(1, dao.create(foo));
    DatabaseConnection conn = connectionSource.getReadOnlyConnection();
    CompiledStatement stmt = null;
    try {
      stmt = conn.compileStatement("select * from " + TABLE_NAME, StatementType.SELECT, noFieldTypes);
      DatabaseResults results = stmt.runQuery();
      assertTrue(results.next());
      FieldType fieldType =
          FieldType.createFieldType(connectionSource, TABLE_NAME,
              clazz.getDeclaredField(SERIALIZABLE_COLUMN), clazz);
View Full Code Here

Examples of com.j256.ormlite.support.DatabaseConnection.compileStatement()

    foo.byteField = new byte[] { 1, 2, 3, 4, 5 };
    assertEquals(1, dao.create(foo));
    DatabaseConnection conn = connectionSource.getReadOnlyConnection();
    CompiledStatement stmt = null;
    try {
      stmt = conn.compileStatement("select * from " + TABLE_NAME, StatementType.SELECT, noFieldTypes);
      DatabaseResults results = stmt.runQuery();
      assertTrue(results.next());
      FieldType fieldType =
          FieldType.createFieldType(connectionSource, TABLE_NAME,
              LocalSerializable.class.getDeclaredField(SERIALIZABLE_COLUMN), LocalSerializable.class);
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.