Java Code Examples for com.j256.ormlite.support.DatabaseConnection#DEFAULT_RESULT_FLAGS
The following examples show how to use
com.j256.ormlite.support.DatabaseConnection#DEFAULT_RESULT_FLAGS .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JdbcDatabaseConnection.java From ormlite-jdbc with ISC License | 5 votes |
@Override public int executeStatement(String statementStr, int resultFlags) throws SQLException { if (resultFlags == DatabaseConnection.DEFAULT_RESULT_FLAGS) { resultFlags = ResultSet.TYPE_FORWARD_ONLY; } Statement statement = connection.createStatement(resultFlags, ResultSet.CONCUR_READ_ONLY); statement.execute(statementStr); return statement.getUpdateCount(); }
Example 2
Source File: JdbcDatabaseConnection.java From ormlite-jdbc with ISC License | 5 votes |
@Override public CompiledStatement compileStatement(String statement, StatementType type, FieldType[] argFieldTypes, int resultFlags, boolean cacheStore) throws SQLException { if (resultFlags == DatabaseConnection.DEFAULT_RESULT_FLAGS) { resultFlags = ResultSet.TYPE_FORWARD_ONLY; } JdbcCompiledStatement compiledStatement = new JdbcCompiledStatement( connection.prepareStatement(statement, resultFlags, ResultSet.CONCUR_READ_ONLY), type, cacheStore); logger.trace("compiled statement: {}", statement); return compiledStatement; }
Example 3
Source File: H2DatabaseConnection.java From ormlite-core with ISC License | 5 votes |
@Override public int executeStatement(String statementStr, int resultFlags) throws SQLException { if (resultFlags == DatabaseConnection.DEFAULT_RESULT_FLAGS) { resultFlags = ResultSet.TYPE_FORWARD_ONLY; } Statement statement = connection.createStatement(resultFlags, ResultSet.CONCUR_READ_ONLY); statement.execute(statementStr); return statement.getUpdateCount(); }
Example 4
Source File: H2DatabaseConnection.java From ormlite-core with ISC License | 5 votes |
@Override public CompiledStatement compileStatement(String statement, StatementType type, FieldType[] argFieldTypes, int resultFlags, boolean cacheStore) throws SQLException { PreparedStatement stmt; if (resultFlags == DatabaseConnection.DEFAULT_RESULT_FLAGS) { stmt = connection.prepareStatement(statement, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); } else { stmt = connection.prepareStatement(statement, resultFlags, ResultSet.CONCUR_READ_ONLY); } return new H2CompiledStatement(stmt, cacheStore); }