/** * Close the result set of the cursored stream. */ public void closeCursor(ResultSet resultSet, AbstractSession session) throws DatabaseException { try { resultSet.close(); } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * Close the result set of the cursored stream. */ public void closeCursor(ResultSet resultSet, AbstractSession session) throws DatabaseException { try { resultSet.close(); } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * Close the result set of the cursored stream. */ public void closeCursor(ResultSet resultSet, AbstractSession session) throws DatabaseException { try { resultSet.close(); } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * Advance the result set and return a Record populated * with values from the next valid row in the result set. Intended solely * for cursored stream support. */ public AbstractRecord cursorRetrieveNextRow(Vector fields, ResultSet resultSet, AbstractSession session) throws DatabaseException { try { if (resultSet.next()) { return fetchRow(fields, resultSet, resultSet.getMetaData(), session); } else { return null; } } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * Advance the result set and return a Record populated * with values from the next valid row in the result set. Intended solely * for cursored stream support. */ public AbstractRecord cursorRetrieveNextRow(Vector fields, ResultSet resultSet, AbstractSession session) throws DatabaseException { try { if (resultSet.next()) { return fetchRow(fields, resultSet, resultSet.getMetaData(), session); } else { return null; } } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * Build a row from the output parameters of a sp call. */ public AbstractRecord buildOutputRow(CallableStatement statement, DatabaseCall call, AbstractSession session) throws DatabaseException { try { return call.buildOutputRow(statement, this, session); } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * Build a row from the output parameters of a sp call. */ public AbstractRecord buildOutputRow(CallableStatement statement, DatabaseCall call, AbstractSession session) throws DatabaseException { try { return call.buildOutputRow(statement, this, session); } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * Build a row from the output parameters of a sp call. */ public AbstractRecord buildOutputRow(CallableStatement statement, DatabaseCall call, AbstractSession session) throws DatabaseException { try { return call.buildOutputRow(statement); } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * Advance the result set and return a DatabaseRow populated * with values from the next valid row in the result set. Intended solely * for scrollable cursor support. */ public AbstractRecord cursorRetrievePreviousRow(Vector fields, ResultSet resultSet, AbstractSession session) throws DatabaseException { try { if (resultSet.previous()) { return fetchRow(fields, resultSet, resultSet.getMetaData(), session); } else { return null; } } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * PUBLIC: * Moves the cursor to the front of the result set, just before the first row */ public void beforeFirst() throws DatabaseException { clearNextAndPrevious(); try { this.resultSet.beforeFirst(); setPosition(0); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * Moves the cursor to the front of the result set, just before the first row */ public void beforeFirst() throws DatabaseException { clearNextAndPrevious(); try { this.resultSet.beforeFirst(); setPosition(0); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * Commit a transaction on the database. This means toggling the auto-commit option. */ public void basicCommitTransaction(AbstractSession session) throws DatabaseException { try { if (getPlatform().supportsAutoCommit()) { getConnection().commit(); getConnection().setAutoCommit(true); } else { getPlatform().commitTransaction(this); } } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * Begin a transaction on the database. This means toggling the auto-commit option. */ public void basicBeginTransaction(AbstractSession session) throws DatabaseException { try { if (getPlatform().supportsAutoCommit()) { getConnection().setAutoCommit(false); } else { getPlatform().beginTransaction(this); } } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * Begin a transaction on the database. This means toggling the auto-commit option. */ @Override public void basicBeginTransaction(AbstractSession session) throws DatabaseException { try { if (getPlatform().supportsAutoCommit()) { getConnection().setAutoCommit(false); } else { getPlatform().beginTransaction(this); } } catch (SQLException exception) { DatabaseException commException = processExceptionForCommError(session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, this, session, false); } }
/** * PUBLIC: * Moves the cursor to the front of the result set, just before the first row */ public void beforeFirst() throws DatabaseException { clearNextAndPrevious(); try { getResultSet().beforeFirst(); setPosition(0); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(getSession(), exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), getSession(), false); } }
/** * Connect to the database. * Exceptions are caught and re-thrown as EclipseLink exceptions. * Must set the transaction isolation. */ @Override protected void connectInternal(Login login, AbstractSession session) throws DatabaseException { super.connectInternal(login, session); checkTransactionIsolation(session); try { session.getPlatform().initializeConnectionData(getConnection()); } catch (java.sql.SQLException sqlEx) { DatabaseException commException = processExceptionForCommError(session, sqlEx, null); if (commException != null) throw commException; throw DatabaseException.sqlException(sqlEx, this, session, false); } }
/** * Connect to the database. * Exceptions are caught and re-thrown as EclipseLink exceptions. * Must set the transaction isolation. */ @Override protected void connectInternal(Login login, AbstractSession session) throws DatabaseException { super.connectInternal(login, session); checkTransactionIsolation(session); try { session.getPlatform().initializeConnectionData(getConnection()); } catch (java.sql.SQLException sqlEx) { DatabaseException commException = processExceptionForCommError(session, sqlEx, null); if (commException != null) throw commException; throw DatabaseException.sqlException(sqlEx, this, session, false); } }
/** * PUBLIC: * Moves the cursor to the end of the result set, just after the last row. */ public void afterLast() throws DatabaseException { clearNextAndPrevious(); try { this.resultSet.afterLast(); setPosition(size() + 1); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * Moves the cursor to the end of the result set, just after the last row. */ public void afterLast() throws DatabaseException { clearNextAndPrevious(); try { this.resultSet.afterLast(); setPosition(size() + 1); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(this.session, exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), this.session, false); } }
/** * PUBLIC: * Moves the cursor to the end of the result set, just after the last row. */ public void afterLast() throws DatabaseException { clearNextAndPrevious(); try { getResultSet().afterLast(); setPosition(size() + 1); } catch (SQLException exception) { DatabaseException commException = getAccessor().processExceptionForCommError(getSession(), exception, null); if (commException != null) throw commException; throw DatabaseException.sqlException(exception, getAccessor(), getSession(), false); } }