/** * Prepare the SQL statement for the call. * First check if the statement is cached before building a new one. * Currently the SQL string is used as the cache key, this may have to be switched if it becomes a performance problem. */ public Statement prepareStatement(DatabaseCall call, AbstractSession session) throws SQLException { return prepareStatement(call, session,false); }
/** * Prepare the SQL statement for the call. * First check if the statement is cached before building a new one. * Currently the SQL string is used as the cache key, this may have to be switched if it becomes a performance problem. */ public Statement prepareStatement(DatabaseCall call, AbstractSession session) throws SQLException { return prepareStatement(call, session,false); }
/** * Prepare the SQL statement for the call. * First check if the statement is cached before building a new one. * Currently the SQL string is used as the cache key, this may have to be switched if it becomes a performance problem. */ public Statement prepareStatement(DatabaseCall call, AbstractSession session) throws SQLException { return prepareStatement(call, session,false); }
/** * INTERNAL: * Prepare the JDBC statement, this may be parameterize or a call statement. * If caching statements this must check for the pre-prepared statement and re-bind to it. */ public Statement prepareStatement(DatabaseAccessor accessor, AbstractRecord translationRow, AbstractSession session) throws SQLException { //#Bug5200836 pass shouldUnwrapConnection flag to indicate whether or not using unwrapped connection. Statement statement = accessor.prepareStatement(this, session); // Setup the max rows returned and query timeout limit. if (this.queryTimeout > 0) { statement.setQueryTimeout(this.queryTimeout); } if (!this.ignoreMaxResultsSetting && this.maxRows > 0) { statement.setMaxRows(this.maxRows); } if (this.resultSetFetchSize > 0) { statement.setFetchSize(this.resultSetFetchSize); } if (this.parameters == null) { return statement; } List parameters = getParameters(); int size = parameters.size(); for (int index = 0; index < size; index++) { session.getPlatform().setParameterValueInDatabaseCall(parameters.get(index), (PreparedStatement)statement, index+1, session); } return statement; }
/** * INTERNAL: * Prepare the JDBC statement, this may be parameterize or a call statement. * If caching statements this must check for the pre-prepared statement and re-bind to it. */ public Statement prepareStatement(DatabaseAccessor accessor, AbstractRecord translationRow, AbstractSession session) throws SQLException { //#Bug5200836 pass shouldUnwrapConnection flag to indicate whether or not using unwrapped connection. Statement statement = accessor.prepareStatement(this, session); // Setup the max rows returned and query timeout limit. if (this.queryTimeout > 0) { statement.setQueryTimeout(this.queryTimeout); } if (!this.ignoreFirstRowMaxResultsSettings && this.maxRows > 0) { statement.setMaxRows(this.maxRows); } if (this.resultSetFetchSize > 0) { statement.setFetchSize(this.resultSetFetchSize); } if (this.parameters == null) { return statement; } List parameters = getParameters(); int size = parameters.size(); for (int index = 0; index < size; index++) { session.getPlatform().setParameterValueInDatabaseCall(parameters.get(index), (PreparedStatement)statement, index+1, session); } return statement; }
Statement statement = accessor.prepareStatement(this, session);
DatabasePlatform platform = session.getPlatform(); boolean shouldUnwrapConnection = platform.usesNativeBatchWriting(); statement = (PreparedStatement)this.databaseAccessor.prepareStatement(this.previousCall, session, shouldUnwrapConnection);
DatabasePlatform platform = session.getPlatform(); boolean shouldUnwrapConnection = platform.usesNativeBatchWriting(); statement = (PreparedStatement)this.databaseAccessor.prepareStatement(this.previousCall, session, shouldUnwrapConnection);
try { boolean shouldUnwrapConnection = session.getPlatform().usesNativeBatchWriting(); statement = (PreparedStatement)this.databaseAccessor.prepareStatement(this.previousCall, session, shouldUnwrapConnection);