private static PSQLException cannotCastException(final String fromType, final String toType, final Exception cause) { return new PSQLException( GT.tr("Cannot convert an instance of {0} to type {1}", fromType, toType), PSQLState.INVALID_PARAMETER_TYPE, cause); }
public String getSavepointName() throws SQLException { if (!_isValid) { throw new PSQLException(GT.tr("Cannot reference a savepoint after it has been released."), PSQLState.INVALID_SAVEPOINT_SPECIFICATION); } if (!_isNamed) { throw new PSQLException(GT.tr("Cannot retrieve the name of an unnamed savepoint."), PSQLState.WRONG_OBJECT_TYPE); } return _name; }
private void checkFreed() throws SQLException { if (_freed) { throw new PSQLException(GT.tr("This SQLXML object has already been freed."), PSQLState.OBJECT_NOT_IN_STATE); } }
private void initialize() throws SQLException { if (_initialized) { throw new PSQLException( GT.tr( "This SQLXML object has already been initialized, so you cannot manipulate it further."), PSQLState.OBJECT_NOT_IN_STATE); } _initialized = true; }
public java.sql.ResultSet executeQuery(String p_sql) throws SQLException { throw new PSQLException( GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); }
@Override public void registerOutParameter(int index, int sqlType) throws SQLException { if (index < 1 || index > paramValues.length) { throw new PSQLException( GT.tr("The column index is out of range: {0}, number of columns: {1}.", index, paramValues.length), PSQLState.INVALID_PARAMETER_VALUE); } flags[index - 1] |= OUT; }
protected void handleCopydata(byte[] data) throws PSQLException { throw new PSQLException(GT.tr("CopyIn copy direction can't receive data"), PSQLState.PROTOCOL_VIOLATION); } }
public int executeUpdate(String p_sql) throws SQLException { throw new PSQLException( GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); }
protected void checkColumnIndex(int column) throws SQLException { if (column < 1 || column > fields.length) { throw new PSQLException( GT.tr("The column index is out of range: {0}, number of columns: {1}.", column, fields.length), PSQLState.INVALID_PARAMETER_VALUE); } }
private void checkParamIndex(int param) throws PSQLException { if (param < 1 || param > _oids.length) { throw new PSQLException( GT.tr("The parameter index is out of range: {0}, number of parameters: {1}.", param, _oids.length), PSQLState.INVALID_PARAMETER_VALUE); } }
public boolean wasNull() throws SQLException { if (lastIndex == 0) { throw new PSQLException(GT.tr("wasNull cannot be call before fetching a result."), PSQLState.OBJECT_NOT_IN_STATE); } // check to see if the last access threw an exception return (callResult[lastIndex - 1] == null); }
/** * Checks that this LOB hasn't been free()d already. * * @throws SQLException if LOB has been freed. */ protected void checkFreed() throws SQLException { if (subLOs == null) { throw new PSQLException(GT.tr("free() was called on this LOB previously"), PSQLState.OBJECT_NOT_IN_STATE); } }
public int getSavepointId() throws SQLException { if (!_isValid) { throw new PSQLException(GT.tr("Cannot reference a savepoint after it has been released."), PSQLState.INVALID_SAVEPOINT_SPECIFICATION); } if (_isNamed) { throw new PSQLException(GT.tr("Cannot retrieve the id of a named savepoint."), PSQLState.WRONG_OBJECT_TYPE); } return _id; }
public void setFetchDirection(int direction) throws SQLException { switch (direction) { case ResultSet.FETCH_FORWARD: case ResultSet.FETCH_REVERSE: case ResultSet.FETCH_UNKNOWN: fetchdirection = direction; break; default: throw new PSQLException(GT.tr("Invalid fetch direction constant: {0}.", direction), PSQLState.INVALID_PARAMETER_VALUE); } }
public boolean execute(String p_sql) throws SQLException { throw new PSQLException( GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); }
protected void checkClosed() throws SQLException { if (rows == null) { throw new PSQLException(GT.tr("This ResultSet is closed."), PSQLState.OBJECT_NOT_IN_STATE); } }
/** * Checks that this LOB hasn't been free()d already. * @throws SQLException if LOB has been freed. */ protected void checkFreed() throws SQLException { if (lo == null) throw new PSQLException(GT.tr("free() was called on this LOB previously"), PSQLState.OBJECT_NOT_IN_STATE); }
public int getSavepointId() throws SQLException { if (!_isValid) throw new PSQLException(GT.tr("Cannot reference a savepoint after it has been released."), PSQLState.INVALID_SAVEPOINT_SPECIFICATION); if (_isNamed) throw new PSQLException(GT.tr("Cannot retrieve the id of a named savepoint."), PSQLState.WRONG_OBJECT_TYPE); return _id; }
public String getSavepointName() throws SQLException { if (!_isValid) throw new PSQLException(GT.tr("Cannot reference a savepoint after it has been released."), PSQLState.INVALID_SAVEPOINT_SPECIFICATION); if (!_isNamed) throw new PSQLException(GT.tr("Cannot retrieve the name of an unnamed savepoint."), PSQLState.WRONG_OBJECT_TYPE); return _name; }
public boolean wasNull() throws SQLException { if (lastIndex == 0) throw new PSQLException(GT.tr("wasNull cannot be call before fetching a result."), PSQLState.OBJECT_NOT_IN_STATE); // check to see if the last access threw an exception return (callResult[lastIndex-1] == null); }