/** * PUBLIC: Used to define a store procedure or SQL query. */ public void setDatasourceCall(Call call) { if (call == null) { return; } setQueryMechanism(call.buildNewQueryMechanism(this)); }
/** * PUBLIC: Used to define a store procedure or SQL query. This may be used * for multiple SQL executions to be mapped to a single query. This cannot * be used for cursored selects, delete alls or does exists. */ public void addCall(Call call) { setQueryMechanism(call.buildQueryMechanism(this, getQueryMechanism())); // Must un-prepare is prepare as the SQL may change. setIsPrepared(false); }
/** * Execute the call. * @return depending of the type either the row count, row or vector of rows. */ public Object executeCall(Call call, AbstractRecord translationRow, AbstractSession session) throws DatabaseException { // If the login is null, then this accessor has never been connected. if (this.login == null) { throw DatabaseException.databaseAccessorNotConnected(); } if (session.shouldLog(SessionLog.FINE, SessionLog.SQL)) {// pre-check to improve performance session.log(SessionLog.FINE, SessionLog.SQL, call.getLogString(this), (Object[])null, this, false); } Object result = basicExecuteCall(call, translationRow, session); return result; }
if (call.isOneRowReturned()) { break; } else if (call.isNothingReturned()) {
/** * INTERNAL: * Override From session. Get the accessor based on the query, and execute call, * this is here for session broker. */ public Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException { Collection<Accessor> accessors = query.getSession().getAccessors(call, translationRow, query); query.setAccessors(accessors); try { return basicExecuteCall(call, translationRow, query); } finally { if (call.isFinished()) { query.setAccessor(null); } } }
/** * INTERNAL: * Change the internal query to data modify query. */ protected void setAsDataModifyQuery() { DataModifyQuery query = new DataModifyQuery(); query.setIsUserDefined(this.databaseQuery.isUserDefined()); // By default, do not batch user native queries, as row count must be returned. query.setIsBatchExecutionSupported(false); query.copyFromQuery(this.databaseQuery); // Need to clone call, in case was executed as read. query.setDatasourceCall((Call) this.databaseQuery.getDatasourceCall().clone()); this.databaseQuery = query; }
/** * INTERNAL: * Overridden by subclasses that do more than just execute the call. * Executes the call directly on this session and does not check which * session it should have executed on. */ public Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException { if (query.getAccessors() == null) { query.setAccessors(getAccessors()); } try { return basicExecuteCall(call, translationRow, query); } finally { if (call.isFinished()) { query.setAccessors(null); } } }
if (call.isOneRowReturned()) { break; } else if (call.isNothingReturned()) {
/** * INTERNAL: * Override From session. Get the accessor based on the query, and execute call, * this is here for session broker. */ @Override public Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException { Collection<Accessor> accessors = query.getSession().getAccessors(call, translationRow, query); query.setAccessors(accessors); try { return basicExecuteCall(call, translationRow, query); } finally { if (call.isFinished()) { query.setAccessor(null); } } }
/** * Execute the call. * @return depending of the type either the row count, row or vector of rows. */ public Object executeCall(Call call, AbstractRecord translationRow, AbstractSession session) throws DatabaseException { // If the login is null, then this accessor has never been connected. if (this.login == null) { throw DatabaseException.databaseAccessorNotConnected(); } if (session.shouldLog(SessionLog.FINE, SessionLog.SQL)) {// pre-check to improve performance session.log(SessionLog.FINE, SessionLog.SQL, call.getLogString(this), (Object[])null, this, false); } Object result = basicExecuteCall(call, translationRow, session); return result; }
/** * PUBLIC: Used to define a store procedure or SQL query. */ public void setDatasourceCall(Call call) { if (call == null) { return; } setQueryMechanism(call.buildNewQueryMechanism(this)); }
/** * PUBLIC: Used to define a store procedure or SQL query. This may be used * for multiple SQL executions to be mapped to a single query. This cannot * be used for cursored selects, delete alls or does exists. */ public void addCall(Call call) { setQueryMechanism(call.buildQueryMechanism(this, getQueryMechanism())); // Must un-prepare is prepare as the SQL may change. setIsPrepared(false); }
/** * INTERNAL: * Overridden by subclasses that do more than just execute the call. * Executes the call directly on this session and does not check which * session it should have executed on. */ public Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException { if (query.getAccessors() == null) { query.setAccessors(getAccessors()); } try { return basicExecuteCall(call, translationRow, query); } finally { if (call.isFinished()) { query.setAccessors(null); } } }
/** * Execute the call. * @return depending of the type either the row count, row or vector of rows. */ public Object executeCall(Call call, AbstractRecord translationRow, AbstractSession session) throws DatabaseException { // If the login is null, then this accessor has never been connected. if (this.login == null) { throw DatabaseException.databaseAccessorNotConnected(); } if (session.shouldLog(SessionLog.FINE, SessionLog.SQL)) {// pre-check to improve performance session.log(SessionLog.FINE, SessionLog.SQL, call.getLogString(this), (Object[])null, this, false); } Object result = basicExecuteCall(call, translationRow, session); return result; }
/** * PUBLIC: * Used to define a store procedure or SQL query. */ public void setDatasourceCall(Call call) { if (call == null) { return; } setQueryMechanism(call.buildNewQueryMechanism(this)); }
/** * PUBLIC: * Used to define a store procedure or SQL query. * This may be used for multiple SQL executions to be mapped to a single query. * This cannot be used for cursored selects, delete alls or does exists. */ public void addCall(Call call) { setQueryMechanism(call.buildQueryMechanism(this, getQueryMechanism())); // Must un-prepare is prepare as the SQL may change. setIsPrepared(false); }
/** * INTERNAL: * Overridden by subclasses that do more than just execute the call. * Executes the call directly on this session and does not check which * session it should have executed on. */ public Object executeCall(Call call, AbstractRecord translationRow, DatabaseQuery query) throws DatabaseException { //** sequencing refactoring if (query.getAccessor() == null) { query.setAccessor(getAccessor()); } try { return query.getAccessor().executeCall(call, translationRow, this); } finally { if (call.isFinished()) { query.setAccessor(null); } } }
writer.write(ExceptionMessageGenerator.getHeader("CallHeader")); if (getAccessor() != null) { writer.write(getCall().getLogString(getAccessor())); } else { writer.write(getCall().toString());
if (call.isFinished() || exception != null) { try { if (accessorAllocated) {
writer.write(ExceptionMessageGenerator.getHeader("CallHeader")); if (getAccessor() != null) { writer.write(getCall().getLogString(getAccessor())); } else { writer.write(getCall().toString());