/** * INTERNAL: * Return the SQL string for the call. */ public String getCallString() { return getSQLString(); }
/** * INTERNAL: * Return the query string (SQL) of the call. */ public String getQueryString() { return getSQLString(); }
/** * INTERNAL: * Print the SQL string. */ public String toString() { String str = Helper.getShortClassName(getClass()); if (getSQLString() == null) { return str; } else { return str + "(" + getSQLString() + ")"; } }
/** * Try to print the SQL. */ public String toString() { StringWriter writer = new StringWriter(); writer.write(Helper.getShortClassName(getClass())); writer.write("("); try { DatabaseCall call = buildCall(new DatabaseSessionImpl(new oracle.toplink.essentials.sessions.DatabaseLogin())); writer.write(call.getSQLString()); } catch (Exception exception) { } writer.write(")"); return writer.toString(); } }
/** * Return the SQL string for logging purposes. */ public String getLogString(Accessor accessor) { if (hasParameters()) { StringWriter writer = new StringWriter(); writer.write(getSQLString()); writer.write(Helper.cr()); if (hasParameters()) { AbstractSession session = null; if (getQuery() != null) { session = getQuery().getSession(); } appendLogParameters(getParameters(), accessor, writer, session); } return writer.toString(); } else { return getSQLString(); } }
statement = (PreparedStatement)getStatementCache().get(call.getSQLString()); if (statement != null) { getStatementCache().remove(call.getSQLString()); statement = getConnection().prepareCall(call.getSQLString(), call.getResultSetType(), call.getResultSetConcurrency()); } else { statement = getConnection().prepareCall(call.getSQLString()); statement = getConnection().prepareStatement(call.getSQLString(), call.getResultSetType(), call.getResultSetConcurrency()); } else if (call.isDynamicCall(session)) { } else { statement = getConnection().prepareStatement(call.getSQLString());
releaseStatement((PreparedStatement)statement, dbCall.getSQLString(), dbCall, session); } else { closeStatement(statement, session);
/** * Execute the statement. */ protected ResultSet executeSelect(DatabaseCall call, Statement statement, AbstractSession session) throws SQLException { ResultSet resultSet; session.startOperationProfile(SessionProfiler.STATEMENT_EXECUTE); try { if (call.isDynamicCall(session)) { resultSet = statement.executeQuery(call.getSQLString()); } else { resultSet = ((PreparedStatement)statement).executeQuery(); } } finally { session.endOperationProfile(SessionProfiler.STATEMENT_EXECUTE); } // Allow for procs with outputs to be raised as events for error handling. if (call.shouldBuildOutputRow()) { AbstractRecord outputRow = buildOutputRow((CallableStatement)statement, call, session); call.getQuery().setProperty("output", outputRow); session.getEventManager().outputParametersDetected(outputRow, call); } return resultSet; }
/** * Execute the statement. */ public Integer executeDirectNoSelect(Statement statement, DatabaseCall call, AbstractSession session) throws DatabaseException { int rowCount = 0; try { session.startOperationProfile(SessionProfiler.STATEMENT_EXECUTE); if ((call != null) && call.isDynamicCall(session)) { rowCount = statement.executeUpdate(call.getSQLString()); } else { rowCount = ((PreparedStatement)statement).executeUpdate(); } if ((!getPlatform().supportsAutoCommit()) && (!isInTransaction())) { getPlatform().autoCommit(this); } } catch (SQLException exception) { if (!getPlatform().shouldIgnoreException(exception)) { throw DatabaseException.sqlException(exception, this, session); } } finally { session.endOperationProfile(SessionProfiler.STATEMENT_EXECUTE); } return new Integer(rowCount); }
DatabaseAccessor.this.releaseStatement(statement, dbCall.getSQLString(), dbCall, session); } catch (SQLException exception) { results.throwException(DatabaseException.sqlException(exception, DatabaseAccessor.this, session));
releaseStatement(statement, dbCall.getSQLString(), dbCall, session); } catch (SQLException exception) { throw DatabaseException.sqlException(exception, this, session);