Class PgResultSet
- All Implemented Interfaces:
AutoCloseable, ResultSet, Wrapper, PGRefCursorResultSet
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass(package private) static classprivate class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprivate static final BigIntegerprivate static final BigIntegerprotected final BaseConnectionprotected intprotected ResultCursorprivate TimeZoneprivate PreparedStatementprivate booleanprivate static final NumberFormatExceptionA dummy exception thrown when fast byte[] to number parsing fails and no value can be returned.private intprotected intprotected final Field[]private static final BigIntegerprivate static final BigIntegerprotected intprivate static final LocalDateprivate final ResourceLockprivate static final doubleprivate static final floatprivate static final doubleprivate static final floatprivate static final BigIntegerprivate static final BigIntegerprotected final intprotected final intprotected booleanprivate Stringprotected final Queryprivate List<PgResultSet.PrimaryKey> private Stringprivate final intprivate final intprivate Tupleprotected intprivate ResultSetMetaDataprivate static final BigIntegerprivate static final BigIntegerprivate booleanprotected final BaseStatementprivate Stringprotected Tupleprivate TimestampUtilsprivate booleanprivate booleanprotected SQLWarningprotected booleanTrue if the last obtained column value was SQL NULL as specified bywasNull().Fields inherited from interface ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE -
Constructor Summary
ConstructorsConstructorDescriptionPgResultSet(Query originalQuery, BaseStatement statement, Field[] fields, List<Tuple> tuples, ResultCursor cursor, int maxRows, int maxFieldSize, int rsType, int rsConcurrency, int rsHoldability, boolean adaptiveFetch) -
Method Summary
Modifier and TypeMethodDescriptionbooleanabsolute(int index) (package private) voidUsed to add rows to an already existing ResultSet that exactly match the existing rows.protected voidaddWarning(SQLWarning warnings) voidvoidvoidprotected voidprotected voidcheckColumnIndex(int column) private voidprivate voidprivate voidclearRowBuffer(boolean copyCurrentRow) voidvoidclose()protected voidprivate voidCloses<unnamed portal 1>if no more fetch calls expected (cursor==null)createColumnNameIndexMap(Field[] fields, boolean isSanitiserDisabled) protected ResultSetMetaDatavoidintfindColumn(String columnName) private intfindColumnIndex(String columnName) booleanfirst()booleanGet state of adaptive fetch for resultSet.getArray(int i) getAsciiStream(int columnIndex) getAsciiStream(String columnName) getBigDecimal(int columnIndex) getBigDecimal(int columnIndex, int scale) getBigDecimal(String columnName) getBigDecimal(String columnName, int scale) getBinaryStream(int columnIndex) getBinaryStream(String columnName) getBlob(int i) booleangetBoolean(int columnIndex) Retrieves the value of the designated column in the current row of thisResultSetobject as abooleanin the Java programming language.booleangetBoolean(String columnName) bytegetByte(int columnIndex) bytebyte[]getBytes(int columnIndex) byte[]getCharacterStream(int i) getCharacterStream(String columnName) getClob(int i) intgetColumnOID(int field) Returns the OID of a field.intgetDate(int columnIndex) private CalendardoublegetDouble(int columnIndex) doubleprivate static BigDecimalgetFastBigDecimal(byte[] bytes) Optimised byte[] to number parser.intintgetFixedString(int col) This is used to fix get*() methods on Money fields.floatgetFloat(int columnIndex) floatintintgetInt(int columnIndex) intintGet fetch size used during last fetch.private LocalDategetLocalDate(int i) private LocalDateTimegetLocalDateTime(int i) private LocalTimegetLocalTime(int i) longgetLong(int columnIndex) longgetNCharacterStream(int columnIndex) getNCharacterStream(String columnName) getNClob(int columnIndex) getNString(int columnIndex) getNString(String columnName) private NumbergetNumeric(int columnIndex, int scale, boolean allowSpecial) getObject(int columnIndex) <T> T<T> TgetObjectImpl(int i, Map<String, Class<?>> map) getObjectImpl(String columnName, Map<String, Class<?>> map) private OffsetDateTimegetOffsetDateTime(int i) private OffsetTimegetOffsetTime(int i) protected StringgetPGType(int column) protected byte[]getRawValue(int column) Checks that the result set is not closed, it's positioned on a valid row and that the given column number is valid.getRef(int i) intgetRow()getRowId(int columnIndex) shortgetShort(int columnIndex) shortprotected intgetSQLType(int column) getSQLXML(int columnIndex) getString(int columnIndex) getTime(int columnIndex) getTimestamp(int columnIndex) getTimestamp(int i, Calendar cal) getTimestamp(String columnName) getTimestamp(String c, Calendar cal) private TimestampUtilsintgetType()getUnicodeStream(int columnIndex) getUnicodeStream(String columnName) getURL(int columnIndex) protected ObjectgetUUID(byte[] data) protected Objectprivate voidprivate voidinitSqlType(Field field) voidprotected ObjectinternalGetObject(int columnIndex, Field field) booleanbooleanprotected booleanisBinary(int column) Returns true if the value of the given column is in binary format.booleanisClosed()private booleanisColumnTrimmable(int columnIndex) booleanisFirst()booleanisLast()protected boolean(package private) booleanIs this ResultSet updateable?booleanisWrapperFor(Class<?> iface) booleanlast()protected ArraymakeArray(int oid, byte[] value) protected Arrayprotected BlobmakeBlob(long oid) protected ClobmakeClob(long oid) voidvoidbooleannext()private voidbooleanprevious()static String[]quotelessTableName(String fullname) Cracks out the table name and schema (if it exists) from a fully qualified table name.private static doublereadDoubleValue(byte[] bytes, int oid, String targetType) Converts any numeric binary field to double value.private static longreadLongValue(byte[] bytes, int oid, long minVal, long maxVal, String targetType) Converts any numeric binary field to long value.voidbooleanrelative(int rows) booleanbooleanbooleanprivate static BigDecimalscaleBigDecimal(BigDecimal val, int scale) voidsetAdaptiveFetch(boolean adaptiveFetch) Turn on/off adaptive fetch for ResultSet.voidsetFetchDirection(int direction) voidsetFetchSize(int rows) private voidsetRefCursor(String refCursorName) private voidsetRowBufferColumn(Tuple rowBuffer, int columnIndex, Object valueObject) static BigDecimalstatic BigDecimaltoBigDecimal(String s, int scale) static doublestatic floatstatic intstatic longstatic shortprivate byte[]trimBytes(int columnIndex, byte[] bytes) private static Stringprivate StringtrimString(int columnIndex, String string) <T> TvoidupdateArray(int columnIndex, Array x) voidupdateArray(String columnName, Array x) voidupdateAsciiStream(int columnIndex, InputStream inputStream) voidupdateAsciiStream(int columnIndex, InputStream x, int length) voidupdateAsciiStream(int columnIndex, InputStream inputStream, long length) voidupdateAsciiStream(String columnName, InputStream inputStream) voidupdateAsciiStream(String columnName, InputStream x, int length) voidupdateAsciiStream(String columnName, InputStream inputStream, long length) voidupdateBigDecimal(int columnIndex, BigDecimal x) voidupdateBigDecimal(String columnName, BigDecimal x) voidupdateBinaryStream(int columnIndex, InputStream inputStream) voidupdateBinaryStream(int columnIndex, InputStream x, int length) voidupdateBinaryStream(int columnIndex, InputStream inputStream, long length) voidupdateBinaryStream(String columnName, InputStream inputStream) voidupdateBinaryStream(String columnName, InputStream x, int length) voidupdateBinaryStream(String columnName, InputStream inputStream, long length) voidupdateBlob(int columnIndex, InputStream inputStream) voidupdateBlob(int columnIndex, InputStream inputStream, long length) voidupdateBlob(int columnIndex, Blob x) voidupdateBlob(String columnName, InputStream inputStream) voidupdateBlob(String columnName, InputStream inputStream, long length) voidupdateBlob(String columnName, Blob x) voidupdateBoolean(int columnIndex, boolean x) voidupdateBoolean(String columnName, boolean x) voidupdateByte(int columnIndex, byte x) voidupdateByte(String columnName, byte x) voidupdateBytes(int columnIndex, byte[] x) voidupdateBytes(String columnName, byte[] x) voidupdateCharacterStream(int columnIndex, Reader reader) voidupdateCharacterStream(int columnIndex, Reader x, int length) voidupdateCharacterStream(int columnIndex, Reader reader, long length) voidupdateCharacterStream(String columnName, Reader reader) voidupdateCharacterStream(String columnName, Reader reader, int length) voidupdateCharacterStream(String columnName, Reader reader, long length) voidupdateClob(int columnIndex, Reader reader) voidupdateClob(int columnIndex, Reader reader, long length) voidupdateClob(int columnIndex, Clob x) voidupdateClob(String columnName, Reader reader) voidupdateClob(String columnName, Reader reader, long length) voidupdateClob(String columnName, Clob x) voidupdateDate(int columnIndex, Date x) voidupdateDate(String columnName, Date x) voidupdateDouble(int columnIndex, double x) voidupdateDouble(String columnName, double x) voidupdateFloat(int columnIndex, float x) voidupdateFloat(String columnName, float x) voidupdateInt(int columnIndex, int x) voidvoidupdateLong(int columnIndex, long x) voidupdateLong(String columnName, long x) voidupdateNCharacterStream(int columnIndex, Reader x) voidupdateNCharacterStream(int columnIndex, Reader x, int length) voidupdateNCharacterStream(int columnIndex, Reader x, long length) voidupdateNCharacterStream(String columnName, Reader x) voidupdateNCharacterStream(String columnName, Reader x, int length) voidupdateNCharacterStream(String columnName, Reader x, long length) voidupdateNClob(int columnIndex, Reader reader) voidupdateNClob(int columnIndex, Reader reader, long length) voidupdateNClob(int columnIndex, NClob nClob) voidupdateNClob(String columnName, Reader reader) voidupdateNClob(String columnName, Reader reader, long length) voidupdateNClob(String columnName, NClob nClob) voidupdateNString(int columnIndex, String nString) voidupdateNString(String columnName, String nString) voidupdateNull(int columnIndex) voidupdateNull(String columnName) voidupdateObject(int columnIndex, Object x) voidupdateObject(int columnIndex, Object x, int scale) voidupdateObject(int columnIndex, Object x, SQLType targetSqlType) voidupdateObject(int columnIndex, Object x, SQLType targetSqlType, int scaleOrLength) voidupdateObject(String columnName, Object x) voidupdateObject(String columnName, Object x, int scale) voidupdateObject(String columnLabel, Object x, SQLType targetSqlType) voidupdateObject(String columnLabel, Object x, SQLType targetSqlType, int scaleOrLength) private voidupdateQueryInsideAdaptiveFetchCache(boolean newAdaptiveFetch) Update adaptive fetch cache during changing state of adaptive fetch inside ResultSet.voidvoidvoidprivate voidupdateRowBuffer(PreparedStatement insertStatement, Tuple rowBuffer, Map<String, Object> updateValues) voidupdateRowId(int columnIndex, RowId x) voidupdateRowId(String columnName, RowId x) voidupdateShort(int columnIndex, short x) voidupdateShort(String columnName, short x) voidupdateSQLXML(int columnIndex, SQLXML xmlObject) voidupdateSQLXML(String columnName, SQLXML xmlObject) voidupdateString(int columnIndex, String x) voidupdateString(String columnName, String x) voidupdateTime(int columnIndex, Time x) voidupdateTime(String columnName, Time x) voidupdateTimestamp(int columnIndex, Timestamp x) voidupdateTimestamp(String columnName, Timestamp x) protected voidupdateValue(int columnIndex, Object value) protected PgResultSetThis is here to be used by metadata functions to make all column labels upper case.booleanwasNull()
-
Field Details
-
updateable
private boolean updateable -
doingUpdates
private boolean doingUpdates -
updateValues
-
usingOID
private boolean usingOID -
-
singleTable
private boolean singleTable -
onlyTable
-
tableName
-
deleteStatement
-
resultsettype
private final int resultsettype -
resultsetconcurrency
private final int resultsetconcurrency -
fetchdirection
private int fetchdirection -
defaultTimeZone
-
connection
-
statement
-
fields
-
originalQuery
-
timestampUtils
-
maxRows
protected final int maxRows -
maxFieldSize
protected final int maxFieldSize -
rows
-
currentRow
protected int currentRow -
rowOffset
protected int rowOffset -
thisRow
-
warnings
-
wasNullFlag
protected boolean wasNullFlagTrue if the last obtained column value was SQL NULL as specified bywasNull(). The value is always updated by thegetRawValue(int)method. -
onInsertRow
protected boolean onInsertRow -
rowBuffer
-
fetchSize
protected int fetchSize -
lastUsedFetchSize
protected int lastUsedFetchSize -
adaptiveFetch
protected boolean adaptiveFetch -
cursor
-
columnNameIndexMap
-
rsMetaData
-
lock
-
LOCAL_DATE_EPOCH
-
refCursorName
-
BYTEMAX
-
BYTEMIN
-
FAST_NUMBER_FAILED
A dummy exception thrown when fast byte[] to number parsing fails and no value can be returned. The exact stack trace does not matter because the exception is always caught and is not visible to users. -
SHORTMAX
-
SHORTMIN
-
INTMAX
-
INTMIN
-
LONGMAX
-
LONGMIN
-
LONG_MAX_FLOAT
private static final float LONG_MAX_FLOAT -
LONG_MIN_FLOAT
private static final float LONG_MIN_FLOAT -
LONG_MAX_DOUBLE
private static final double LONG_MAX_DOUBLE -
LONG_MIN_DOUBLE
private static final double LONG_MIN_DOUBLE
-
-
Constructor Details
-
PgResultSet
PgResultSet(Query originalQuery, BaseStatement statement, Field[] fields, List<Tuple> tuples, ResultCursor cursor, int maxRows, int maxFieldSize, int rsType, int rsConcurrency, int rsHoldability, boolean adaptiveFetch) throws SQLException - Throws:
SQLException
-
-
Method Details
-
createMetaData
- Throws:
SQLException
-
getMetaData
- Specified by:
getMetaDatain interfaceResultSet- Throws:
SQLException
-
getURL
- Specified by:
getURLin interfaceResultSet- Throws:
SQLException
-
getURL
- Specified by:
getURLin interfaceResultSet- Throws:
SQLException
-
internalGetObject
- Throws:
SQLException
-
checkScrollable
- Throws:
SQLException
-
absolute
- Specified by:
absolutein interfaceResultSet- Throws:
SQLException
-
afterLast
- Specified by:
afterLastin interfaceResultSet- Throws:
SQLException
-
beforeFirst
- Specified by:
beforeFirstin interfaceResultSet- Throws:
SQLException
-
first
- Specified by:
firstin interfaceResultSet- Throws:
SQLException
-
getArray
- Specified by:
getArrayin interfaceResultSet- Throws:
SQLException
-
makeArray
- Throws:
SQLException
-
makeArray
- Throws:
SQLException
-
getArray
- Specified by:
getArrayin interfaceResultSet- Throws:
SQLException
-
getBigDecimal
- Specified by:
getBigDecimalin interfaceResultSet- Throws:
SQLException
-
getBigDecimal
- Specified by:
getBigDecimalin interfaceResultSet- Throws:
SQLException
-
getBlob
- Specified by:
getBlobin interfaceResultSet- Throws:
SQLException
-
makeBlob
- Throws:
SQLException
-
getBlob
- Specified by:
getBlobin interfaceResultSet- Throws:
SQLException
-
getCharacterStream
- Specified by:
getCharacterStreamin interfaceResultSet- Throws:
SQLException
-
getCharacterStream
- Specified by:
getCharacterStreamin interfaceResultSet- Throws:
SQLException
-
getClob
- Specified by:
getClobin interfaceResultSet- Throws:
SQLException
-
makeClob
- Throws:
SQLException
-
getClob
- Specified by:
getClobin interfaceResultSet- Throws:
SQLException
-
getConcurrency
- Specified by:
getConcurrencyin interfaceResultSet- Throws:
SQLException
-
getDate
- Specified by:
getDatein interfaceResultSet- Throws:
SQLException
-
getTime
- Specified by:
getTimein interfaceResultSet- Throws:
SQLException
-
getTimestamp
- Specified by:
getTimestampin interfaceResultSet- Throws:
SQLException
-
getOffsetDateTime
- Throws:
SQLException
-
getOffsetTime
- Throws:
SQLException
-
getLocalDateTime
- Throws:
SQLException
-
getLocalDate
- Throws:
SQLException
-
getLocalTime
- Throws:
SQLException
-
getDate
- Specified by:
getDatein interfaceResultSet- Throws:
SQLException
-
getTime
- Specified by:
getTimein interfaceResultSet- Throws:
SQLException
-
getTimestamp
- Specified by:
getTimestampin interfaceResultSet- Throws:
SQLException
-
getFetchDirection
- Specified by:
getFetchDirectionin interfaceResultSet- Throws:
SQLException
-
getObjectImpl
- Throws:
SQLException
-
getObjectImpl
- Throws:
SQLException
-
getRef
- Specified by:
getRefin interfaceResultSet- Throws:
SQLException
-
getRef
- Specified by:
getRefin interfaceResultSet- Throws:
SQLException
-
getRow
- Specified by:
getRowin interfaceResultSet- Throws:
SQLException
-
getStatement
- Specified by:
getStatementin interfaceResultSet- Throws:
SQLException
-
getType
- Specified by:
getTypein interfaceResultSet- Throws:
SQLException
-
isAfterLast
- Specified by:
isAfterLastin interfaceResultSet- Throws:
SQLException
-
isBeforeFirst
- Specified by:
isBeforeFirstin interfaceResultSet- Throws:
SQLException
-
isFirst
- Specified by:
isFirstin interfaceResultSet- Throws:
SQLException
-
isLast
- Specified by:
isLastin interfaceResultSet- Throws:
SQLException
-
last
- Specified by:
lastin interfaceResultSet- Throws:
SQLException
-
previous
- Specified by:
previousin interfaceResultSet- Throws:
SQLException
-
relative
- Specified by:
relativein interfaceResultSet- Throws:
SQLException
-
setFetchDirection
- Specified by:
setFetchDirectionin interfaceResultSet- Throws:
SQLException
-
cancelRowUpdates
- Specified by:
cancelRowUpdatesin interfaceResultSet- Throws:
SQLException
-
deleteRow
- Specified by:
deleteRowin interfaceResultSet- Throws:
SQLException
-
insertRow
- Specified by:
insertRowin interfaceResultSet- Throws:
SQLException
-
moveToCurrentRow
- Specified by:
moveToCurrentRowin interfaceResultSet- Throws:
SQLException
-
moveToInsertRow
- Specified by:
moveToInsertRowin interfaceResultSet- Throws:
SQLException
-
clearRowBuffer
- Throws:
SQLException
-
rowDeleted
- Specified by:
rowDeletedin interfaceResultSet- Throws:
SQLException
-
rowInserted
- Specified by:
rowInsertedin interfaceResultSet- Throws:
SQLException
-
rowUpdated
- Specified by:
rowUpdatedin interfaceResultSet- Throws:
SQLException
-
updateAsciiStream
- Specified by:
updateAsciiStreamin interfaceResultSet- Throws:
SQLException
-
updateBigDecimal
- Specified by:
updateBigDecimalin interfaceResultSet- Throws:
SQLException
-
updateBinaryStream
- Specified by:
updateBinaryStreamin interfaceResultSet- Throws:
SQLException
-
updateBoolean
- Specified by:
updateBooleanin interfaceResultSet- Throws:
SQLException
-
updateByte
- Specified by:
updateBytein interfaceResultSet- Throws:
SQLException
-
updateBytes
- Specified by:
updateBytesin interfaceResultSet- Throws:
SQLException
-
updateCharacterStream
- Specified by:
updateCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateDate
- Specified by:
updateDatein interfaceResultSet- Throws:
SQLException
-
updateDouble
- Specified by:
updateDoublein interfaceResultSet- Throws:
SQLException
-
updateFloat
- Specified by:
updateFloatin interfaceResultSet- Throws:
SQLException
-
updateInt
- Specified by:
updateIntin interfaceResultSet- Throws:
SQLException
-
updateLong
- Specified by:
updateLongin interfaceResultSet- Throws:
SQLException
-
updateNull
- Specified by:
updateNullin interfaceResultSet- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Throws:
SQLException
-
refreshRow
- Specified by:
refreshRowin interfaceResultSet- Throws:
SQLException
-
updateRow
- Specified by:
updateRowin interfaceResultSet- Throws:
SQLException
-
updateShort
- Specified by:
updateShortin interfaceResultSet- Throws:
SQLException
-
updateString
- Specified by:
updateStringin interfaceResultSet- Throws:
SQLException
-
updateTime
- Specified by:
updateTimein interfaceResultSet- Throws:
SQLException
-
updateTimestamp
- Specified by:
updateTimestampin interfaceResultSet- Throws:
SQLException
-
updateNull
- Specified by:
updateNullin interfaceResultSet- Throws:
SQLException
-
updateBoolean
- Specified by:
updateBooleanin interfaceResultSet- Throws:
SQLException
-
updateByte
- Specified by:
updateBytein interfaceResultSet- Throws:
SQLException
-
updateShort
- Specified by:
updateShortin interfaceResultSet- Throws:
SQLException
-
updateInt
- Specified by:
updateIntin interfaceResultSet- Throws:
SQLException
-
updateLong
- Specified by:
updateLongin interfaceResultSet- Throws:
SQLException
-
updateFloat
- Specified by:
updateFloatin interfaceResultSet- Throws:
SQLException
-
updateDouble
- Specified by:
updateDoublein interfaceResultSet- Throws:
SQLException
-
updateBigDecimal
- Specified by:
updateBigDecimalin interfaceResultSet- Throws:
SQLException
-
updateString
- Specified by:
updateStringin interfaceResultSet- Throws:
SQLException
-
updateBytes
- Specified by:
updateBytesin interfaceResultSet- Throws:
SQLException
-
updateDate
- Specified by:
updateDatein interfaceResultSet- Throws:
SQLException
-
updateTime
- Specified by:
updateTimein interfaceResultSet- Throws:
SQLException
-
updateTimestamp
- Specified by:
updateTimestampin interfaceResultSet- Throws:
SQLException
-
updateAsciiStream
- Specified by:
updateAsciiStreamin interfaceResultSet- Throws:
SQLException
-
updateBinaryStream
- Specified by:
updateBinaryStreamin interfaceResultSet- Throws:
SQLException
-
updateCharacterStream
- Specified by:
updateCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Throws:
SQLException
-
isUpdateable
-
setAdaptiveFetch
Turn on/off adaptive fetch for ResultSet.- Parameters:
adaptiveFetch- desired state of adaptive fetch.- Throws:
SQLException- exception returned if ResultSet is closed
-
updateQueryInsideAdaptiveFetchCache
private void updateQueryInsideAdaptiveFetchCache(boolean newAdaptiveFetch) Update adaptive fetch cache during changing state of adaptive fetch inside ResultSet. Update inside AdaptiveFetchCache is required to collect data about max result row length for that query to compute adaptive fetch size.- Parameters:
newAdaptiveFetch- new state of adaptive fetch
-
getAdaptiveFetch
Get state of adaptive fetch for resultSet.- Returns:
- state of adaptive fetch (turned on or off)
- Throws:
SQLException- exception returned if ResultSet is closed
-
quotelessTableName
Cracks out the table name and schema (if it exists) from a fully qualified table name.- Parameters:
fullname- string that we are trying to crack. Test cases:Table: table () "Table": Table () Schema.Table: table (schema) "Schema"."Table": Table (Schema) "Schema"."Dot.Table": Dot.Table (Schema) Schema."Dot.Table": Dot.Table (schema)- Returns:
- String array with element zero always being the tablename and element 1 the schema name which may be a zero length string.
-
parseQuery
private void parseQuery() -
setRowBufferColumn
private void setRowBufferColumn(Tuple rowBuffer, int columnIndex, Object valueObject) throws SQLException - Throws:
SQLException
-
updateRowBuffer
private void updateRowBuffer(PreparedStatement insertStatement, Tuple rowBuffer, Map<String, Object> updateValues) throws SQLException- Throws:
SQLException
-
getPGStatement
-
getRefCursor
- Specified by:
getRefCursorin interfacePGRefCursorResultSet- Returns:
- the name of the cursor.
-
setRefCursor
-
setFetchSize
- Specified by:
setFetchSizein interfaceResultSet- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSizein interfaceResultSet- Throws:
SQLException
-
getLastUsedFetchSize
Get fetch size used during last fetch. Returned value can be useful if using adaptive fetch.- Returns:
- fetch size used during last fetch.
- Throws:
SQLException- exception returned if ResultSet is closed
-
next
- Specified by:
nextin interfaceResultSet- Throws:
SQLException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceResultSet- Throws:
SQLException
-
closeInternally
- Throws:
SQLException
-
closeRefCursor
Closes<unnamed portal 1>if no more fetch calls expected (cursor==null)- Throws:
SQLException- if portal close fails
-
wasNull
- Specified by:
wasNullin interfaceResultSet- Throws:
SQLException
-
getString
- Specified by:
getStringin interfaceResultSet- Throws:
SQLException
-
getBoolean
Retrieves the value of the designated column in the current row of thisResultSetobject as abooleanin the Java programming language.If the designated column has a Character datatype and is one of the following values: "1", "true", "t", "yes", "y" or "on", a value of
trueis returned. If the designated column has a Character datatype and is one of the following values: "0", "false", "f", "no", "n" or "off", a value offalseis returned. Leading or trailing whitespace is ignored, and case does not matter.If the designated column has a Numeric datatype and is a 1, a value of
trueis returned. If the designated column has a Numeric datatype and is a 0, a value offalseis returned.- Specified by:
getBooleanin interfaceResultSet- Parameters:
columnIndex- the first column is 1, the second is 2, ...- Returns:
- the column value; if the value is SQL
NULL, the value returned isfalse - Throws:
SQLException- if the columnIndex is not valid; if a database access error occurs; if this method is called on a closed result set or is an invalid cast to boolean type.- See Also:
-
getByte
- Specified by:
getBytein interfaceResultSet- Throws:
SQLException
-
getShort
- Specified by:
getShortin interfaceResultSet- Throws:
SQLException
-
getInt
- Specified by:
getIntin interfaceResultSet- Throws:
SQLException
-
getLong
- Specified by:
getLongin interfaceResultSet- Throws:
SQLException
-
getFastBigDecimal
Optimised byte[] to number parser. This code does not handle null values, so the caller must do checkResultSet and handle null values prior to calling this function.- Parameters:
bytes- integer represented as a sequence of ASCII bytes- Returns:
- The parsed number.
- Throws:
NumberFormatException- If the number is invalid or the out of range for fast parsing. The value must then be parsed bytoBigDecimal(String, int).
-
getFloat
- Specified by:
getFloatin interfaceResultSet- Throws:
SQLException
-
getDouble
- Specified by:
getDoublein interfaceResultSet- Throws:
SQLException
-
getBigDecimal
- Specified by:
getBigDecimalin interfaceResultSet- Throws:
SQLException
-
getNumeric
- Throws:
SQLException
-
getBytes
In normal use, the bytes represent the raw values returned by the backend. However, if the column is an OID, then it is assumed to refer to a Large Object, and that object is returned as a byte array.
Be warned If the large object is huge, then you may run out of memory.
- Specified by:
getBytesin interfaceResultSet- Throws:
SQLException
-
getDate
- Specified by:
getDatein interfaceResultSet- Throws:
SQLException
-
getTime
- Specified by:
getTimein interfaceResultSet- Throws:
SQLException
-
getTimestamp
- Specified by:
getTimestampin interfaceResultSet- Throws:
SQLException
-
getAsciiStream
- Specified by:
getAsciiStreamin interfaceResultSet- Throws:
SQLException
-
getUnicodeStream
- Specified by:
getUnicodeStreamin interfaceResultSet- Throws:
SQLException
-
getBinaryStream
- Specified by:
getBinaryStreamin interfaceResultSet- Throws:
SQLException
-
getString
- Specified by:
getStringin interfaceResultSet- Throws:
SQLException
-
getBoolean
- Specified by:
getBooleanin interfaceResultSet- Throws:
SQLException
-
getByte
- Specified by:
getBytein interfaceResultSet- Throws:
SQLException
-
getShort
- Specified by:
getShortin interfaceResultSet- Throws:
SQLException
-
getInt
- Specified by:
getIntin interfaceResultSet- Throws:
SQLException
-
getLong
- Specified by:
getLongin interfaceResultSet- Throws:
SQLException
-
getFloat
- Specified by:
getFloatin interfaceResultSet- Throws:
SQLException
-
getDouble
- Specified by:
getDoublein interfaceResultSet- Throws:
SQLException
-
getBigDecimal
- Specified by:
getBigDecimalin interfaceResultSet- Throws:
SQLException
-
getBytes
- Specified by:
getBytesin interfaceResultSet- Throws:
SQLException
-
getDate
- Specified by:
getDatein interfaceResultSet- Throws:
SQLException
-
getTime
- Specified by:
getTimein interfaceResultSet- Throws:
SQLException
-
getTimestamp
- Specified by:
getTimestampin interfaceResultSet- Throws:
SQLException
-
getAsciiStream
- Specified by:
getAsciiStreamin interfaceResultSet- Throws:
SQLException
-
getUnicodeStream
- Specified by:
getUnicodeStreamin interfaceResultSet- Throws:
SQLException
-
getBinaryStream
- Specified by:
getBinaryStreamin interfaceResultSet- Throws:
SQLException
-
getWarnings
- Specified by:
getWarningsin interfaceResultSet- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceResultSet- Throws:
SQLException
-
addWarning
-
getCursorName
- Specified by:
getCursorNamein interfaceResultSet- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceResultSet- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceResultSet- Throws:
SQLException
-
findColumn
- Specified by:
findColumnin interfaceResultSet- Throws:
SQLException
-
createColumnNameIndexMap
-
findColumnIndex
-
getColumnOID
public int getColumnOID(int field) Returns the OID of a field. It is used internally by the driver.- Parameters:
field- field index- Returns:
- OID of a field
-
getFixedString
This is used to fix get*() methods on Money fields. It should only be used by those methods!It converts ($##.##) to -##.## and $##.## to ##.##
- Parameters:
col- column position (1-based)- Returns:
- numeric-parsable representation of money string literal
- Throws:
SQLException- if something wrong happens
-
trimMoney
-
getPGType
- Throws:
SQLException
-
getSQLType
- Throws:
SQLException
-
initSqlType
- Throws:
SQLException
-
checkUpdateable
- Throws:
SQLException
-
checkClosed
- Throws:
SQLException
-
isResultSetClosed
protected boolean isResultSetClosed() -
checkColumnIndex
- Throws:
SQLException
-
getRawValue
Checks that the result set is not closed, it's positioned on a valid row and that the given column number is valid. Also updates thewasNullFlagto correct value.- Parameters:
column- The column number to check. Range starts from 1.- Returns:
- raw value or null
- Throws:
SQLException- If state or column is invalid.
-
isBinary
protected boolean isBinary(int column) Returns true if the value of the given column is in binary format.- Parameters:
column- The column to check. Range starts from 1.- Returns:
- True if the column is in binary format.
-
toShort
- Throws:
SQLException
-
toInt
- Throws:
SQLException
-
toLong
- Throws:
SQLException
-
toBigDecimal
- Throws:
SQLException
-
toBigDecimal
- Throws:
SQLException
-
scaleBigDecimal
- Throws:
PSQLException
-
toFloat
- Throws:
SQLException
-
toDouble
- Throws:
SQLException
-
initRowBuffer
private void initRowBuffer() -
isColumnTrimmable
- Throws:
SQLException
-
trimBytes
- Throws:
SQLException
-
trimString
- Throws:
SQLException
-
readDoubleValue
private static double readDoubleValue(byte[] bytes, int oid, String targetType) throws PSQLException Converts any numeric binary field to double value. This method does no overflow checking.- Parameters:
bytes- The bytes of the numeric field.oid- The oid of the field.targetType- The target type. Used for error reporting.- Returns:
- The value as double.
- Throws:
PSQLException- If the field type is not supported numeric type.
-
readLongValue
private static long readLongValue(byte[] bytes, int oid, long minVal, long maxVal, String targetType) throws PSQLException Converts any numeric binary field to long value.This method is used by getByte,getShort,getInt and getLong. It must support a subset of the following java types that use Binary encoding. (fields that use text encoding use a different code path).
byte,short,int,long,float,double,BigDecimal,boolean,string.- Parameters:
bytes- The bytes of the numeric field.oid- The oid of the field.minVal- the minimum value allowed.maxVal- the maximum value allowed.targetType- The target type. Used for error reporting.- Returns:
- The value as long.
- Throws:
PSQLException- If the field type is not supported numeric type or if the value is out of range.
-
updateValue
- Throws:
SQLException
-
getUUID
- Throws:
SQLException
-
getUUID
- Throws:
SQLException
-
addRows
-
updateRef
- Specified by:
updateRefin interfaceResultSet- Throws:
SQLException
-
updateRef
- Specified by:
updateRefin interfaceResultSet- Throws:
SQLException
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Throws:
SQLException
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Throws:
SQLException
-
updateArray
- Specified by:
updateArrayin interfaceResultSet- Throws:
SQLException
-
updateArray
- Specified by:
updateArrayin interfaceResultSet- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceResultSet- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceResultSet- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceResultSet- Throws:
SQLException
-
getObject
- Specified by:
getObjectin interfaceResultSet- Throws:
SQLException
-
updateObject
public void updateObject(int columnIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException - Specified by:
updateObjectin interfaceResultSet- Throws:
SQLException
-
updateObject
public void updateObject(String columnLabel, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException - Specified by:
updateObjectin interfaceResultSet- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Throws:
SQLException
-
getRowId
- Specified by:
getRowIdin interfaceResultSet- Throws:
SQLException
-
getRowId
- Specified by:
getRowIdin interfaceResultSet- Throws:
SQLException
-
updateRowId
- Specified by:
updateRowIdin interfaceResultSet- Throws:
SQLException
-
updateRowId
- Specified by:
updateRowIdin interfaceResultSet- Throws:
SQLException
-
getHoldability
- Specified by:
getHoldabilityin interfaceResultSet- Throws:
SQLException
-
isClosed
- Specified by:
isClosedin interfaceResultSet- Throws:
SQLException
-
updateNString
- Specified by:
updateNStringin interfaceResultSet- Throws:
SQLException
-
updateNString
- Specified by:
updateNStringin interfaceResultSet- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Throws:
SQLException
-
getNClob
- Specified by:
getNClobin interfaceResultSet- Throws:
SQLException
-
getNClob
- Specified by:
getNClobin interfaceResultSet- Throws:
SQLException
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Throws:
SQLException
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Throws:
SQLException
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Throws:
SQLException
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Throws:
SQLException
-
getSQLXML
- Specified by:
getSQLXMLin interfaceResultSet- Throws:
SQLException
-
getSQLXML
- Specified by:
getSQLXMLin interfaceResultSet- Throws:
SQLException
-
updateSQLXML
- Specified by:
updateSQLXMLin interfaceResultSet- Throws:
SQLException
-
updateSQLXML
- Specified by:
updateSQLXMLin interfaceResultSet- Throws:
SQLException
-
getNString
- Specified by:
getNStringin interfaceResultSet- Throws:
SQLException
-
getNString
- Specified by:
getNStringin interfaceResultSet- Throws:
SQLException
-
getNCharacterStream
- Specified by:
getNCharacterStreamin interfaceResultSet- Throws:
SQLException
-
getNCharacterStream
- Specified by:
getNCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateNCharacterStream
- Throws:
SQLException
-
updateNCharacterStream
- Throws:
SQLException
-
updateNCharacterStream
- Specified by:
updateNCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateNCharacterStream
- Specified by:
updateNCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateNCharacterStream
- Specified by:
updateNCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateNCharacterStream
- Specified by:
updateNCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateCharacterStream
- Specified by:
updateCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateCharacterStream
public void updateCharacterStream(String columnName, Reader reader, long length) throws SQLException - Specified by:
updateCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateCharacterStream
- Specified by:
updateCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateCharacterStream
- Specified by:
updateCharacterStreamin interfaceResultSet- Throws:
SQLException
-
updateBinaryStream
public void updateBinaryStream(int columnIndex, InputStream inputStream, long length) throws SQLException - Specified by:
updateBinaryStreamin interfaceResultSet- Throws:
SQLException
-
updateBinaryStream
public void updateBinaryStream(String columnName, InputStream inputStream, long length) throws SQLException - Specified by:
updateBinaryStreamin interfaceResultSet- Throws:
SQLException
-
updateBinaryStream
- Specified by:
updateBinaryStreamin interfaceResultSet- Throws:
SQLException
-
updateBinaryStream
- Specified by:
updateBinaryStreamin interfaceResultSet- Throws:
SQLException
-
updateAsciiStream
public void updateAsciiStream(int columnIndex, InputStream inputStream, long length) throws SQLException - Specified by:
updateAsciiStreamin interfaceResultSet- Throws:
SQLException
-
updateAsciiStream
public void updateAsciiStream(String columnName, InputStream inputStream, long length) throws SQLException - Specified by:
updateAsciiStreamin interfaceResultSet- Throws:
SQLException
-
updateAsciiStream
- Specified by:
updateAsciiStreamin interfaceResultSet- Throws:
SQLException
-
updateAsciiStream
- Specified by:
updateAsciiStreamin interfaceResultSet- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
getDefaultCalendar
-
getTimestampUtils
-
upperCaseFieldLabels
This is here to be used by metadata functions to make all column labels upper case. Because postgres folds columns to lower case in queries it will be easier to change the fields after the fact rather than try to coerce all the columns to upper case in the queries as this would require surrounding all columns with " and escaping them making them even harder to read than they are now.- Returns:
- PgResultSet
-