Class PgResultSet
- java.lang.Object
-
- org.postgresql.jdbc.PgResultSet
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.sql.ResultSet,java.sql.Wrapper,PGRefCursorResultSet
public class PgResultSet extends java.lang.Object implements java.sql.ResultSet, PGRefCursorResultSet
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classPgResultSet.CursorResultHandler(package private) static classPgResultSet.NullObjectprivate classPgResultSet.PrimaryKey
-
Field Summary
Fields Modifier and Type Field Description private static java.math.BigIntegerBYTEMAXprivate static java.math.BigIntegerBYTEMINprivate java.util.Map<java.lang.String,java.lang.Integer>columnNameIndexMapprotected BaseConnectionconnectionprotected intcurrentRowprotected ResultCursorcursorprivate java.util.TimeZonedefaultTimeZoneprivate java.sql.PreparedStatementdeleteStatementprivate booleandoingUpdatesprivate static java.lang.NumberFormatExceptionFAST_NUMBER_FAILEDA dummy exception thrown when fast byte[] to number parsing fails and no value can be returned.private intfetchdirectionprotected intfetchSizeprotected Field[]fieldsprivate static java.math.BigIntegerINTMAXprivate static java.math.BigIntegerINTMINprivate static java.math.BigIntegerLONGMAXprivate static java.math.BigIntegerLONGMINprotected intmaxFieldSizeprotected intmaxRowsprotected booleanonInsertRowprivate java.lang.StringonlyTableprotected QueryoriginalQueryprivate java.util.List<PgResultSet.PrimaryKey>primaryKeysprivate java.lang.StringrefCursorNameprivate intresultsetconcurrencyprivate intresultsettypeprivate TuplerowBufferprotected introwOffsetprotected java.util.List<Tuple>rowsprivate java.sql.ResultSetMetaDatarsMetaDataprivate static java.math.BigIntegerSHORTMAXprivate static java.math.BigIntegerSHORTMINprivate booleansingleTableprotected BaseStatementstatementprivate java.lang.StringtableNameprotected TuplethisRowprivate booleanupdateableprivate java.util.HashMap<java.lang.String,java.lang.Object>updateValuesprivate booleanusingOIDprotected java.sql.SQLWarningwarningsprotected booleanwasNullFlagTrue if the last obtained column value was SQL NULL as specified bywasNull().
-
Constructor Summary
Constructors Constructor Description PgResultSet(Query originalQuery, BaseStatement statement, Field[] fields, java.util.List<Tuple> tuples, ResultCursor cursor, int maxRows, int maxFieldSize, int rsType, int rsConcurrency, int rsHoldability)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabsolute(int index)(package private) voidaddRows(java.util.List<Tuple> tuples)Used to add rows to an already existing ResultSet that exactly match the existing rows.protected voidaddWarning(java.sql.SQLWarning warnings)voidafterLast()voidbeforeFirst()voidcancelRowUpdates()protected voidcheckClosed()protected voidcheckColumnIndex(int column)private voidcheckScrollable()private voidcheckUpdateable()private voidclearRowBuffer(boolean copyCurrentRow)voidclearWarnings()voidclose()protected voidcloseInternally()static java.util.Map<java.lang.String,java.lang.Integer>createColumnNameIndexMap(Field[] fields, boolean isSanitiserDisabled)protected java.sql.ResultSetMetaDatacreateMetaData()voiddeleteRow()intfindColumn(java.lang.String columnName)private intfindColumnIndex(java.lang.String columnName)booleanfirst()java.sql.ArraygetArray(int i)java.sql.ArraygetArray(java.lang.String colName)java.io.InputStreamgetAsciiStream(int columnIndex)java.io.InputStreamgetAsciiStream(java.lang.String columnName)java.math.BigDecimalgetBigDecimal(int columnIndex)java.math.BigDecimalgetBigDecimal(int columnIndex, int scale)java.math.BigDecimalgetBigDecimal(java.lang.String columnName)java.math.BigDecimalgetBigDecimal(java.lang.String columnName, int scale)java.io.InputStreamgetBinaryStream(int columnIndex)java.io.InputStreamgetBinaryStream(java.lang.String columnName)java.sql.BlobgetBlob(int i)java.sql.BlobgetBlob(java.lang.String columnName)booleangetBoolean(int columnIndex)Retrieves the value of the designated column in the current row of thisResultSetobject as abooleanin the Java programming language.booleangetBoolean(java.lang.String columnName)bytegetByte(int columnIndex)bytegetByte(java.lang.String columnName)byte[]getBytes(int columnIndex)byte[]getBytes(java.lang.String columnName)java.io.ReadergetCharacterStream(int i)java.io.ReadergetCharacterStream(java.lang.String columnName)java.sql.ClobgetClob(int i)java.sql.ClobgetClob(java.lang.String columnName)intgetColumnOID(int field)Returns the OID of a field.intgetConcurrency()java.lang.StringgetCursorName()java.sql.DategetDate(int columnIndex)java.sql.DategetDate(int i, java.util.Calendar cal)java.sql.DategetDate(java.lang.String columnName)java.sql.DategetDate(java.lang.String c, java.util.Calendar cal)private java.util.CalendargetDefaultCalendar()doublegetDouble(int columnIndex)doublegetDouble(java.lang.String columnName)private java.math.BigDecimalgetFastBigDecimal(byte[] bytes)Optimised byte[] to number parser.private intgetFastInt(byte[] bytes)Optimised byte[] to number parser.private longgetFastLong(byte[] bytes)Optimised byte[] to number parser.intgetFetchDirection()intgetFetchSize()java.lang.StringgetFixedString(int col)This is used to fix get*() methods on Money fields.floatgetFloat(int columnIndex)floatgetFloat(java.lang.String columnName)intgetHoldability()intgetInt(int columnIndex)intgetInt(java.lang.String columnName)private java.time.LocalDateTimegetLocalDateTime(int i)private java.time.LocalTimegetLocalTime(int i)longgetLong(int columnIndex)longgetLong(java.lang.String columnName)java.sql.ResultSetMetaDatagetMetaData()java.io.ReadergetNCharacterStream(int columnIndex)java.io.ReadergetNCharacterStream(java.lang.String columnName)java.sql.NClobgetNClob(int columnIndex)java.sql.NClobgetNClob(java.lang.String columnName)java.lang.StringgetNString(int columnIndex)java.lang.StringgetNString(java.lang.String columnName)private java.lang.NumbergetNumeric(int columnIndex, int scale, boolean allowNaN)java.lang.ObjectgetObject(int columnIndex)<T> TgetObject(int columnIndex, java.lang.Class<T> type)java.lang.ObjectgetObject(int i, java.util.Map<java.lang.String,java.lang.Class<?>> map)java.lang.ObjectgetObject(java.lang.String columnName)<T> TgetObject(java.lang.String columnLabel, java.lang.Class<T> type)java.lang.ObjectgetObject(java.lang.String s, java.util.Map<java.lang.String,java.lang.Class<?>> map)java.lang.ObjectgetObjectImpl(int i, java.util.Map<java.lang.String,java.lang.Class<?>> map)java.lang.ObjectgetObjectImpl(java.lang.String columnName, java.util.Map<java.lang.String,java.lang.Class<?>> map)private java.time.OffsetDateTimegetOffsetDateTime(int i)BaseStatementgetPGStatement()protected java.lang.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.java.sql.RefgetRef(int i)java.sql.RefgetRef(java.lang.String columnName)java.lang.StringgetRefCursor()intgetRow()java.sql.RowIdgetRowId(int columnIndex)java.sql.RowIdgetRowId(java.lang.String columnName)shortgetShort(int columnIndex)shortgetShort(java.lang.String columnName)protected intgetSQLType(int column)java.sql.SQLXMLgetSQLXML(int columnIndex)java.sql.SQLXMLgetSQLXML(java.lang.String columnName)java.sql.StatementgetStatement()java.lang.StringgetString(int columnIndex)java.lang.StringgetString(java.lang.String columnName)java.sql.TimegetTime(int columnIndex)java.sql.TimegetTime(int i, java.util.Calendar cal)java.sql.TimegetTime(java.lang.String columnName)java.sql.TimegetTime(java.lang.String c, java.util.Calendar cal)java.sql.TimestampgetTimestamp(int columnIndex)java.sql.TimestampgetTimestamp(int i, java.util.Calendar cal)java.sql.TimestampgetTimestamp(java.lang.String columnName)java.sql.TimestampgetTimestamp(java.lang.String c, java.util.Calendar cal)intgetType()java.io.InputStreamgetUnicodeStream(int columnIndex)java.io.InputStreamgetUnicodeStream(java.lang.String columnName)java.net.URLgetURL(int columnIndex)java.net.URLgetURL(java.lang.String columnName)protected java.lang.ObjectgetUUID(byte[] data)protected java.lang.ObjectgetUUID(java.lang.String data)java.sql.SQLWarninggetWarnings()private voidinitRowBuffer()private voidinitSqlType(Field field)voidinsertRow()protected java.lang.ObjectinternalGetObject(int columnIndex, Field field)booleanisAfterLast()booleanisBeforeFirst()protected booleanisBinary(int column)Returns true if the value of the given column is in binary format.booleanisClosed()private booleanisColumnTrimmable(int columnIndex)booleanisFirst()booleanisLast()protected booleanisResultSetClosed()(package private) booleanisUpdateable()Is this ResultSet updateable?booleanisWrapperFor(java.lang.Class<?> iface)booleanlast()protected java.sql.ArraymakeArray(int oid, byte[] value)protected java.sql.ArraymakeArray(int oid, java.lang.String value)protected java.sql.BlobmakeBlob(long oid)protected java.sql.ClobmakeClob(long oid)voidmoveToCurrentRow()voidmoveToInsertRow()booleannext()private voidparseQuery()booleanprevious()static java.lang.String[]quotelessTableName(java.lang.String fullname)Cracks out the table name and schema (if it exists) from a fully qualified table name.private doublereadDoubleValue(byte[] bytes, int oid, java.lang.String targetType)Converts any numeric binary field to double value.private longreadLongValue(byte[] bytes, int oid, long minVal, long maxVal, java.lang.String targetType)Converts any numeric binary field to long value.voidrefreshRow()booleanrelative(int rows)booleanrowDeleted()booleanrowInserted()booleanrowUpdated()private java.math.BigDecimalscaleBigDecimal(java.math.BigDecimal val, int scale)voidsetFetchDirection(int direction)voidsetFetchSize(int rows)private voidsetRefCursor(java.lang.String refCursorName)private voidsetRowBufferColumn(Tuple rowBuffer, int columnIndex, java.lang.Object valueObject)static java.math.BigDecimaltoBigDecimal(java.lang.String s)java.math.BigDecimaltoBigDecimal(java.lang.String s, int scale)static doubletoDouble(java.lang.String s)static floattoFloat(java.lang.String s)static inttoInt(java.lang.String s)static longtoLong(java.lang.String s)static shorttoShort(java.lang.String s)private byte[]trimBytes(int columnIndex, byte[] bytes)private java.lang.StringtrimMoney(java.lang.String s)private java.lang.StringtrimString(int columnIndex, java.lang.String string)<T> Tunwrap(java.lang.Class<T> iface)voidupdateArray(int columnIndex, java.sql.Array x)voidupdateArray(java.lang.String columnName, java.sql.Array x)voidupdateAsciiStream(int columnIndex, java.io.InputStream inputStream)voidupdateAsciiStream(int columnIndex, java.io.InputStream x, int length)voidupdateAsciiStream(int columnIndex, java.io.InputStream inputStream, long length)voidupdateAsciiStream(java.lang.String columnName, java.io.InputStream inputStream)voidupdateAsciiStream(java.lang.String columnName, java.io.InputStream x, int length)voidupdateAsciiStream(java.lang.String columnName, java.io.InputStream inputStream, long length)voidupdateBigDecimal(int columnIndex, java.math.BigDecimal x)voidupdateBigDecimal(java.lang.String columnName, java.math.BigDecimal x)voidupdateBinaryStream(int columnIndex, java.io.InputStream inputStream)voidupdateBinaryStream(int columnIndex, java.io.InputStream x, int length)voidupdateBinaryStream(int columnIndex, java.io.InputStream inputStream, long length)voidupdateBinaryStream(java.lang.String columnName, java.io.InputStream inputStream)voidupdateBinaryStream(java.lang.String columnName, java.io.InputStream x, int length)voidupdateBinaryStream(java.lang.String columnName, java.io.InputStream inputStream, long length)voidupdateBlob(int columnIndex, java.io.InputStream inputStream)voidupdateBlob(int columnIndex, java.io.InputStream inputStream, long length)voidupdateBlob(int columnIndex, java.sql.Blob x)voidupdateBlob(java.lang.String columnName, java.io.InputStream inputStream)voidupdateBlob(java.lang.String columnName, java.io.InputStream inputStream, long length)voidupdateBlob(java.lang.String columnName, java.sql.Blob x)voidupdateBoolean(int columnIndex, boolean x)voidupdateBoolean(java.lang.String columnName, boolean x)voidupdateByte(int columnIndex, byte x)voidupdateByte(java.lang.String columnName, byte x)voidupdateBytes(int columnIndex, byte[] x)voidupdateBytes(java.lang.String columnName, byte[] x)voidupdateCharacterStream(int columnIndex, java.io.Reader reader)voidupdateCharacterStream(int columnIndex, java.io.Reader x, int length)voidupdateCharacterStream(int columnIndex, java.io.Reader reader, long length)voidupdateCharacterStream(java.lang.String columnName, java.io.Reader reader)voidupdateCharacterStream(java.lang.String columnName, java.io.Reader reader, int length)voidupdateCharacterStream(java.lang.String columnName, java.io.Reader reader, long length)voidupdateClob(int columnIndex, java.io.Reader reader)voidupdateClob(int columnIndex, java.io.Reader reader, long length)voidupdateClob(int columnIndex, java.sql.Clob x)voidupdateClob(java.lang.String columnName, java.io.Reader reader)voidupdateClob(java.lang.String columnName, java.io.Reader reader, long length)voidupdateClob(java.lang.String columnName, java.sql.Clob x)voidupdateDate(int columnIndex, java.sql.Date x)voidupdateDate(java.lang.String columnName, java.sql.Date x)voidupdateDouble(int columnIndex, double x)voidupdateDouble(java.lang.String columnName, double x)voidupdateFloat(int columnIndex, float x)voidupdateFloat(java.lang.String columnName, float x)voidupdateInt(int columnIndex, int x)voidupdateInt(java.lang.String columnName, int x)voidupdateLong(int columnIndex, long x)voidupdateLong(java.lang.String columnName, long x)voidupdateNCharacterStream(int columnIndex, java.io.Reader x)voidupdateNCharacterStream(int columnIndex, java.io.Reader x, int length)voidupdateNCharacterStream(int columnIndex, java.io.Reader x, long length)voidupdateNCharacterStream(java.lang.String columnName, java.io.Reader x)voidupdateNCharacterStream(java.lang.String columnName, java.io.Reader x, int length)voidupdateNCharacterStream(java.lang.String columnName, java.io.Reader x, long length)voidupdateNClob(int columnIndex, java.io.Reader reader)voidupdateNClob(int columnIndex, java.io.Reader reader, long length)voidupdateNClob(int columnIndex, java.sql.NClob nClob)voidupdateNClob(java.lang.String columnName, java.io.Reader reader)voidupdateNClob(java.lang.String columnName, java.io.Reader reader, long length)voidupdateNClob(java.lang.String columnName, java.sql.NClob nClob)voidupdateNString(int columnIndex, java.lang.String nString)voidupdateNString(java.lang.String columnName, java.lang.String nString)voidupdateNull(int columnIndex)voidupdateNull(java.lang.String columnName)voidupdateObject(int columnIndex, java.lang.Object x)voidupdateObject(int columnIndex, java.lang.Object x, int scale)voidupdateObject(int columnIndex, java.lang.Object x, java.sql.SQLType targetSqlType)voidupdateObject(int columnIndex, java.lang.Object x, java.sql.SQLType targetSqlType, int scaleOrLength)voidupdateObject(java.lang.String columnName, java.lang.Object x)voidupdateObject(java.lang.String columnName, java.lang.Object x, int scale)voidupdateObject(java.lang.String columnLabel, java.lang.Object x, java.sql.SQLType targetSqlType)voidupdateObject(java.lang.String columnLabel, java.lang.Object x, java.sql.SQLType targetSqlType, int scaleOrLength)voidupdateRef(int columnIndex, java.sql.Ref x)voidupdateRef(java.lang.String columnName, java.sql.Ref x)voidupdateRow()private voidupdateRowBuffer(java.sql.PreparedStatement insertStatement, Tuple rowBuffer, java.util.HashMap<java.lang.String,java.lang.Object> updateValues)voidupdateRowId(int columnIndex, java.sql.RowId x)voidupdateRowId(java.lang.String columnName, java.sql.RowId x)voidupdateShort(int columnIndex, short x)voidupdateShort(java.lang.String columnName, short x)voidupdateSQLXML(int columnIndex, java.sql.SQLXML xmlObject)voidupdateSQLXML(java.lang.String columnName, java.sql.SQLXML xmlObject)voidupdateString(int columnIndex, java.lang.String x)voidupdateString(java.lang.String columnName, java.lang.String x)voidupdateTime(int columnIndex, java.sql.Time x)voidupdateTime(java.lang.String columnName, java.sql.Time x)voidupdateTimestamp(int columnIndex, java.sql.Timestamp x)voidupdateTimestamp(java.lang.String columnName, java.sql.Timestamp x)protected voidupdateValue(int columnIndex, java.lang.Object value)booleanwasNull()
-
-
-
Field Detail
-
updateable
private boolean updateable
-
doingUpdates
private boolean doingUpdates
-
updateValues
private java.util.HashMap<java.lang.String,java.lang.Object> updateValues
-
usingOID
private boolean usingOID
-
primaryKeys
private java.util.List<PgResultSet.PrimaryKey> primaryKeys
-
singleTable
private boolean singleTable
-
onlyTable
private java.lang.String onlyTable
-
tableName
private java.lang.String tableName
-
deleteStatement
private java.sql.PreparedStatement deleteStatement
-
resultsettype
private final int resultsettype
-
resultsetconcurrency
private final int resultsetconcurrency
-
fetchdirection
private int fetchdirection
-
defaultTimeZone
private java.util.TimeZone defaultTimeZone
-
connection
protected final BaseConnection connection
-
statement
protected final BaseStatement statement
-
fields
protected final Field[] fields
-
originalQuery
protected final Query originalQuery
-
maxRows
protected final int maxRows
-
maxFieldSize
protected final int maxFieldSize
-
rows
protected java.util.List<Tuple> rows
-
currentRow
protected int currentRow
-
rowOffset
protected int rowOffset
-
thisRow
protected Tuple thisRow
-
warnings
protected java.sql.SQLWarning warnings
-
wasNullFlag
protected boolean wasNullFlag
True 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
private Tuple rowBuffer
-
fetchSize
protected int fetchSize
-
cursor
protected ResultCursor cursor
-
columnNameIndexMap
private java.util.Map<java.lang.String,java.lang.Integer> columnNameIndexMap
-
rsMetaData
private java.sql.ResultSetMetaData rsMetaData
-
refCursorName
private java.lang.String refCursorName
-
BYTEMAX
private static final java.math.BigInteger BYTEMAX
-
BYTEMIN
private static final java.math.BigInteger BYTEMIN
-
FAST_NUMBER_FAILED
private static final java.lang.NumberFormatException 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
private static final java.math.BigInteger SHORTMAX
-
SHORTMIN
private static final java.math.BigInteger SHORTMIN
-
INTMAX
private static final java.math.BigInteger INTMAX
-
INTMIN
private static final java.math.BigInteger INTMIN
-
LONGMAX
private static final java.math.BigInteger LONGMAX
-
LONGMIN
private static final java.math.BigInteger LONGMIN
-
-
Constructor Detail
-
PgResultSet
PgResultSet(Query originalQuery, BaseStatement statement, Field[] fields, java.util.List<Tuple> tuples, ResultCursor cursor, int maxRows, int maxFieldSize, int rsType, int rsConcurrency, int rsHoldability) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-
Method Detail
-
createMetaData
protected java.sql.ResultSetMetaData createMetaData() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getMetaData
public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException- Specified by:
getMetaDatain interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getURL
public java.net.URL getURL(int columnIndex) throws java.sql.SQLException- Specified by:
getURLin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getURL
public java.net.URL getURL(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getURLin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
internalGetObject
protected java.lang.Object internalGetObject(int columnIndex, Field field) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
checkScrollable
private void checkScrollable() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
absolute
public boolean absolute(int index) throws java.sql.SQLException- Specified by:
absolutein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
afterLast
public void afterLast() throws java.sql.SQLException- Specified by:
afterLastin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
beforeFirst
public void beforeFirst() throws java.sql.SQLException- Specified by:
beforeFirstin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
first
public boolean first() throws java.sql.SQLException- Specified by:
firstin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getArray
public java.sql.Array getArray(java.lang.String colName) throws java.sql.SQLException- Specified by:
getArrayin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
makeArray
protected java.sql.Array makeArray(int oid, byte[] value) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
makeArray
protected java.sql.Array makeArray(int oid, java.lang.String value) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getArray
public java.sql.Array getArray(int i) throws java.sql.SQLException- Specified by:
getArrayin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getBigDecimal
public java.math.BigDecimal getBigDecimal(int columnIndex) throws java.sql.SQLException- Specified by:
getBigDecimalin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getBigDecimal
public java.math.BigDecimal getBigDecimal(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getBigDecimalin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getBlob
public java.sql.Blob getBlob(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getBlobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
makeBlob
protected java.sql.Blob makeBlob(long oid) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getBlob
public java.sql.Blob getBlob(int i) throws java.sql.SQLException- Specified by:
getBlobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getCharacterStream
public java.io.Reader getCharacterStream(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getCharacterStream
public java.io.Reader getCharacterStream(int i) throws java.sql.SQLException- Specified by:
getCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getClob
public java.sql.Clob getClob(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
makeClob
protected java.sql.Clob makeClob(long oid) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getClob
public java.sql.Clob getClob(int i) throws java.sql.SQLException- Specified by:
getClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getConcurrency
public int getConcurrency() throws java.sql.SQLException- Specified by:
getConcurrencyin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getDate
public java.sql.Date getDate(int i, java.util.Calendar cal) throws java.sql.SQLException- Specified by:
getDatein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getTime
public java.sql.Time getTime(int i, java.util.Calendar cal) throws java.sql.SQLException- Specified by:
getTimein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getLocalTime
private java.time.LocalTime getLocalTime(int i) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getTimestamp
public java.sql.Timestamp getTimestamp(int i, java.util.Calendar cal) throws java.sql.SQLException- Specified by:
getTimestampin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getOffsetDateTime
private java.time.OffsetDateTime getOffsetDateTime(int i) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getLocalDateTime
private java.time.LocalDateTime getLocalDateTime(int i) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getDate
public java.sql.Date getDate(java.lang.String c, java.util.Calendar cal) throws java.sql.SQLException- Specified by:
getDatein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getTime
public java.sql.Time getTime(java.lang.String c, java.util.Calendar cal) throws java.sql.SQLException- Specified by:
getTimein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getTimestamp
public java.sql.Timestamp getTimestamp(java.lang.String c, java.util.Calendar cal) throws java.sql.SQLException- Specified by:
getTimestampin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getFetchDirection
public int getFetchDirection() throws java.sql.SQLException- Specified by:
getFetchDirectionin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getObjectImpl
public java.lang.Object getObjectImpl(java.lang.String columnName, java.util.Map<java.lang.String,java.lang.Class<?>> map) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getObjectImpl
public java.lang.Object getObjectImpl(int i, java.util.Map<java.lang.String,java.lang.Class<?>> map) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getRef
public java.sql.Ref getRef(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getRefin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getRef
public java.sql.Ref getRef(int i) throws java.sql.SQLException- Specified by:
getRefin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getRow
public int getRow() throws java.sql.SQLException- Specified by:
getRowin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getStatement
public java.sql.Statement getStatement() throws java.sql.SQLException- Specified by:
getStatementin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getType
public int getType() throws java.sql.SQLException- Specified by:
getTypein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
isAfterLast
public boolean isAfterLast() throws java.sql.SQLException- Specified by:
isAfterLastin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
isBeforeFirst
public boolean isBeforeFirst() throws java.sql.SQLException- Specified by:
isBeforeFirstin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
isFirst
public boolean isFirst() throws java.sql.SQLException- Specified by:
isFirstin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
isLast
public boolean isLast() throws java.sql.SQLException- Specified by:
isLastin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
last
public boolean last() throws java.sql.SQLException- Specified by:
lastin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
previous
public boolean previous() throws java.sql.SQLException- Specified by:
previousin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
relative
public boolean relative(int rows) throws java.sql.SQLException- Specified by:
relativein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
setFetchDirection
public void setFetchDirection(int direction) throws java.sql.SQLException- Specified by:
setFetchDirectionin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
cancelRowUpdates
public void cancelRowUpdates() throws java.sql.SQLException- Specified by:
cancelRowUpdatesin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
deleteRow
public void deleteRow() throws java.sql.SQLException- Specified by:
deleteRowin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
insertRow
public void insertRow() throws java.sql.SQLException- Specified by:
insertRowin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
moveToCurrentRow
public void moveToCurrentRow() throws java.sql.SQLException- Specified by:
moveToCurrentRowin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
moveToInsertRow
public void moveToInsertRow() throws java.sql.SQLException- Specified by:
moveToInsertRowin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
clearRowBuffer
private void clearRowBuffer(boolean copyCurrentRow) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
rowDeleted
public boolean rowDeleted() throws java.sql.SQLException- Specified by:
rowDeletedin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
rowInserted
public boolean rowInserted() throws java.sql.SQLException- Specified by:
rowInsertedin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
rowUpdated
public boolean rowUpdated() throws java.sql.SQLException- Specified by:
rowUpdatedin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateAsciiStream
public void updateAsciiStream(int columnIndex, java.io.InputStream x, int length) throws java.sql.SQLException- Specified by:
updateAsciiStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBigDecimal
public void updateBigDecimal(int columnIndex, java.math.BigDecimal x) throws java.sql.SQLException- Specified by:
updateBigDecimalin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBinaryStream
public void updateBinaryStream(int columnIndex, java.io.InputStream x, int length) throws java.sql.SQLException- Specified by:
updateBinaryStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBoolean
public void updateBoolean(int columnIndex, boolean x) throws java.sql.SQLException- Specified by:
updateBooleanin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateByte
public void updateByte(int columnIndex, byte x) throws java.sql.SQLException- Specified by:
updateBytein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBytes
public void updateBytes(int columnIndex, byte[] x) throws java.sql.SQLException- Specified by:
updateBytesin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateCharacterStream
public void updateCharacterStream(int columnIndex, java.io.Reader x, int length) throws java.sql.SQLException- Specified by:
updateCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateDate
public void updateDate(int columnIndex, java.sql.Date x) throws java.sql.SQLException- Specified by:
updateDatein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateDouble
public void updateDouble(int columnIndex, double x) throws java.sql.SQLException- Specified by:
updateDoublein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateFloat
public void updateFloat(int columnIndex, float x) throws java.sql.SQLException- Specified by:
updateFloatin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateInt
public void updateInt(int columnIndex, int x) throws java.sql.SQLException- Specified by:
updateIntin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateLong
public void updateLong(int columnIndex, long x) throws java.sql.SQLException- Specified by:
updateLongin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNull
public void updateNull(int columnIndex) throws java.sql.SQLException- Specified by:
updateNullin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateObject
public void updateObject(int columnIndex, java.lang.Object x) throws java.sql.SQLException- Specified by:
updateObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateObject
public void updateObject(int columnIndex, java.lang.Object x, int scale) throws java.sql.SQLException- Specified by:
updateObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
refreshRow
public void refreshRow() throws java.sql.SQLException- Specified by:
refreshRowin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateRow
public void updateRow() throws java.sql.SQLException- Specified by:
updateRowin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateShort
public void updateShort(int columnIndex, short x) throws java.sql.SQLException- Specified by:
updateShortin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateString
public void updateString(int columnIndex, java.lang.String x) throws java.sql.SQLException- Specified by:
updateStringin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateTime
public void updateTime(int columnIndex, java.sql.Time x) throws java.sql.SQLException- Specified by:
updateTimein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateTimestamp
public void updateTimestamp(int columnIndex, java.sql.Timestamp x) throws java.sql.SQLException- Specified by:
updateTimestampin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNull
public void updateNull(java.lang.String columnName) throws java.sql.SQLException- Specified by:
updateNullin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBoolean
public void updateBoolean(java.lang.String columnName, boolean x) throws java.sql.SQLException- Specified by:
updateBooleanin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateByte
public void updateByte(java.lang.String columnName, byte x) throws java.sql.SQLException- Specified by:
updateBytein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateShort
public void updateShort(java.lang.String columnName, short x) throws java.sql.SQLException- Specified by:
updateShortin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateInt
public void updateInt(java.lang.String columnName, int x) throws java.sql.SQLException- Specified by:
updateIntin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateLong
public void updateLong(java.lang.String columnName, long x) throws java.sql.SQLException- Specified by:
updateLongin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateFloat
public void updateFloat(java.lang.String columnName, float x) throws java.sql.SQLException- Specified by:
updateFloatin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateDouble
public void updateDouble(java.lang.String columnName, double x) throws java.sql.SQLException- Specified by:
updateDoublein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBigDecimal
public void updateBigDecimal(java.lang.String columnName, java.math.BigDecimal x) throws java.sql.SQLException- Specified by:
updateBigDecimalin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateString
public void updateString(java.lang.String columnName, java.lang.String x) throws java.sql.SQLException- Specified by:
updateStringin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBytes
public void updateBytes(java.lang.String columnName, byte[] x) throws java.sql.SQLException- Specified by:
updateBytesin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateDate
public void updateDate(java.lang.String columnName, java.sql.Date x) throws java.sql.SQLException- Specified by:
updateDatein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateTime
public void updateTime(java.lang.String columnName, java.sql.Time x) throws java.sql.SQLException- Specified by:
updateTimein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateTimestamp
public void updateTimestamp(java.lang.String columnName, java.sql.Timestamp x) throws java.sql.SQLException- Specified by:
updateTimestampin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateAsciiStream
public void updateAsciiStream(java.lang.String columnName, java.io.InputStream x, int length) throws java.sql.SQLException- Specified by:
updateAsciiStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBinaryStream
public void updateBinaryStream(java.lang.String columnName, java.io.InputStream x, int length) throws java.sql.SQLException- Specified by:
updateBinaryStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateCharacterStream
public void updateCharacterStream(java.lang.String columnName, java.io.Reader reader, int length) throws java.sql.SQLException- Specified by:
updateCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateObject
public void updateObject(java.lang.String columnName, java.lang.Object x, int scale) throws java.sql.SQLException- Specified by:
updateObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateObject
public void updateObject(java.lang.String columnName, java.lang.Object x) throws java.sql.SQLException- Specified by:
updateObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
isUpdateable
boolean isUpdateable() throws java.sql.SQLExceptionIs this ResultSet updateable?- Throws:
java.sql.SQLException
-
quotelessTableName
public static java.lang.String[] quotelessTableName(java.lang.String fullname)
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, java.lang.Object valueObject) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
updateRowBuffer
private void updateRowBuffer(java.sql.PreparedStatement insertStatement, Tuple rowBuffer, java.util.HashMap<java.lang.String,java.lang.Object> updateValues) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getPGStatement
public BaseStatement getPGStatement()
-
getRefCursor
public java.lang.String getRefCursor()
- Specified by:
getRefCursorin interfacePGRefCursorResultSet- Returns:
- the name of the cursor.
-
setRefCursor
private void setRefCursor(java.lang.String refCursorName)
-
setFetchSize
public void setFetchSize(int rows) throws java.sql.SQLException- Specified by:
setFetchSizein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getFetchSize
public int getFetchSize() throws java.sql.SQLException- Specified by:
getFetchSizein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
next
public boolean next() throws java.sql.SQLException- Specified by:
nextin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
close
public void close() throws java.sql.SQLException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
closeInternally
protected void closeInternally() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
wasNull
public boolean wasNull() throws java.sql.SQLException- Specified by:
wasNullin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getString
public java.lang.String getString(int columnIndex) throws java.sql.SQLException- Specified by:
getStringin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getBoolean
public boolean getBoolean(int columnIndex) throws java.sql.SQLExceptionRetrieves the value of the designated column in the current row of this
ResultSetobject 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 interfacejava.sql.ResultSet- 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:
java.sql.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:
- PostgreSQL Boolean Type
-
getByte
public byte getByte(int columnIndex) throws java.sql.SQLException- Specified by:
getBytein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getShort
public short getShort(int columnIndex) throws java.sql.SQLException- Specified by:
getShortin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getInt
public int getInt(int columnIndex) throws java.sql.SQLException- Specified by:
getIntin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getLong
public long getLong(int columnIndex) throws java.sql.SQLException- Specified by:
getLongin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getFastLong
private long getFastLong(byte[] bytes) throws java.lang.NumberFormatExceptionOptimised 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:
java.lang.NumberFormatException- If the number is invalid or the out of range for fast parsing. The value must then be parsed bytoLong(String).
-
getFastInt
private int getFastInt(byte[] bytes) throws java.lang.NumberFormatExceptionOptimised 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:
java.lang.NumberFormatException- If the number is invalid or the out of range for fast parsing. The value must then be parsed bytoInt(String).
-
getFastBigDecimal
private java.math.BigDecimal getFastBigDecimal(byte[] bytes) throws java.lang.NumberFormatExceptionOptimised 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:
java.lang.NumberFormatException- If the number is invalid or the out of range for fast parsing. The value must then be parsed bytoBigDecimal(String, int).
-
getFloat
public float getFloat(int columnIndex) throws java.sql.SQLException- Specified by:
getFloatin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getDouble
public double getDouble(int columnIndex) throws java.sql.SQLException- Specified by:
getDoublein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getBigDecimal
public java.math.BigDecimal getBigDecimal(int columnIndex, int scale) throws java.sql.SQLException- Specified by:
getBigDecimalin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getNumeric
private java.lang.Number getNumeric(int columnIndex, int scale, boolean allowNaN) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getBytes
public byte[] getBytes(int columnIndex) throws java.sql.SQLExceptionIn 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 interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getDate
public java.sql.Date getDate(int columnIndex) throws java.sql.SQLException- Specified by:
getDatein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getTime
public java.sql.Time getTime(int columnIndex) throws java.sql.SQLException- Specified by:
getTimein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getTimestamp
public java.sql.Timestamp getTimestamp(int columnIndex) throws java.sql.SQLException- Specified by:
getTimestampin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getAsciiStream
public java.io.InputStream getAsciiStream(int columnIndex) throws java.sql.SQLException- Specified by:
getAsciiStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getUnicodeStream
public java.io.InputStream getUnicodeStream(int columnIndex) throws java.sql.SQLException- Specified by:
getUnicodeStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getBinaryStream
public java.io.InputStream getBinaryStream(int columnIndex) throws java.sql.SQLException- Specified by:
getBinaryStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getString
public java.lang.String getString(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getStringin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getBoolean
public boolean getBoolean(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getBooleanin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getByte
public byte getByte(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getBytein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getShort
public short getShort(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getShortin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getInt
public int getInt(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getIntin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getLong
public long getLong(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getLongin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getFloat
public float getFloat(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getFloatin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getDouble
public double getDouble(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getDoublein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getBigDecimal
public java.math.BigDecimal getBigDecimal(java.lang.String columnName, int scale) throws java.sql.SQLException- Specified by:
getBigDecimalin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getBytes
public byte[] getBytes(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getBytesin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getDate
public java.sql.Date getDate(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getDatein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getTime
public java.sql.Time getTime(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getTimein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getTimestamp
public java.sql.Timestamp getTimestamp(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getTimestampin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getAsciiStream
public java.io.InputStream getAsciiStream(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getAsciiStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getUnicodeStream
public java.io.InputStream getUnicodeStream(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getUnicodeStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getBinaryStream
public java.io.InputStream getBinaryStream(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getBinaryStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getWarnings
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException- Specified by:
getWarningsin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
clearWarnings
public void clearWarnings() throws java.sql.SQLException- Specified by:
clearWarningsin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
addWarning
protected void addWarning(java.sql.SQLWarning warnings)
-
getCursorName
public java.lang.String getCursorName() throws java.sql.SQLException- Specified by:
getCursorNamein interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getObject
public java.lang.Object getObject(int columnIndex) throws java.sql.SQLException- Specified by:
getObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getObject
public java.lang.Object getObject(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
findColumn
public int findColumn(java.lang.String columnName) throws java.sql.SQLException- Specified by:
findColumnin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
createColumnNameIndexMap
public static java.util.Map<java.lang.String,java.lang.Integer> createColumnNameIndexMap(Field[] fields, boolean isSanitiserDisabled)
-
findColumnIndex
private int findColumnIndex(java.lang.String columnName)
-
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
public java.lang.String getFixedString(int col) throws java.sql.SQLExceptionThis 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:
java.sql.SQLException- if something wrong happens
-
trimMoney
private java.lang.String trimMoney(java.lang.String s)
-
getPGType
protected java.lang.String getPGType(int column) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getSQLType
protected int getSQLType(int column) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
initSqlType
private void initSqlType(Field field) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
checkUpdateable
private void checkUpdateable() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
checkClosed
protected void checkClosed() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
isResultSetClosed
protected boolean isResultSetClosed()
-
checkColumnIndex
protected void checkColumnIndex(int column) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getRawValue
protected byte[] getRawValue(int column) throws java.sql.SQLExceptionChecks 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:
java.sql.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
public static short toShort(java.lang.String s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
toInt
public static int toInt(java.lang.String s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
toLong
public static long toLong(java.lang.String s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
toBigDecimal
public static java.math.BigDecimal toBigDecimal(java.lang.String s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
toBigDecimal
public java.math.BigDecimal toBigDecimal(java.lang.String s, int scale) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
scaleBigDecimal
private java.math.BigDecimal scaleBigDecimal(java.math.BigDecimal val, int scale) throws PSQLException- Throws:
PSQLException
-
toFloat
public static float toFloat(java.lang.String s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
toDouble
public static double toDouble(java.lang.String s) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
initRowBuffer
private void initRowBuffer()
-
isColumnTrimmable
private boolean isColumnTrimmable(int columnIndex) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
trimBytes
private byte[] trimBytes(int columnIndex, byte[] bytes) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
trimString
private java.lang.String trimString(int columnIndex, java.lang.String string) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readDoubleValue
private double readDoubleValue(byte[] bytes, int oid, java.lang.String targetType) throws PSQLExceptionConverts 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 long readLongValue(byte[] bytes, int oid, long minVal, long maxVal, java.lang.String targetType) throws PSQLExceptionConverts 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
protected void updateValue(int columnIndex, java.lang.Object value) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getUUID
protected java.lang.Object getUUID(java.lang.String data) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getUUID
protected java.lang.Object getUUID(byte[] data) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
addRows
void addRows(java.util.List<Tuple> tuples)
Used to add rows to an already existing ResultSet that exactly match the existing rows. Currently only used for assembling generated keys from batch statement execution.
-
updateRef
public void updateRef(int columnIndex, java.sql.Ref x) throws java.sql.SQLException- Specified by:
updateRefin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateRef
public void updateRef(java.lang.String columnName, java.sql.Ref x) throws java.sql.SQLException- Specified by:
updateRefin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBlob
public void updateBlob(int columnIndex, java.sql.Blob x) throws java.sql.SQLException- Specified by:
updateBlobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBlob
public void updateBlob(java.lang.String columnName, java.sql.Blob x) throws java.sql.SQLException- Specified by:
updateBlobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateClob
public void updateClob(int columnIndex, java.sql.Clob x) throws java.sql.SQLException- Specified by:
updateClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateClob
public void updateClob(java.lang.String columnName, java.sql.Clob x) throws java.sql.SQLException- Specified by:
updateClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateArray
public void updateArray(int columnIndex, java.sql.Array x) throws java.sql.SQLException- Specified by:
updateArrayin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateArray
public void updateArray(java.lang.String columnName, java.sql.Array x) throws java.sql.SQLException- Specified by:
updateArrayin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getObject
public <T> T getObject(int columnIndex, java.lang.Class<T> type) throws java.sql.SQLException- Specified by:
getObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getObject
public <T> T getObject(java.lang.String columnLabel, java.lang.Class<T> type) throws java.sql.SQLException- Specified by:
getObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getObject
public java.lang.Object getObject(java.lang.String s, java.util.Map<java.lang.String,java.lang.Class<?>> map) throws java.sql.SQLException- Specified by:
getObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getObject
public java.lang.Object getObject(int i, java.util.Map<java.lang.String,java.lang.Class<?>> map) throws java.sql.SQLException- Specified by:
getObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateObject
public void updateObject(int columnIndex, java.lang.Object x, java.sql.SQLType targetSqlType, int scaleOrLength) throws java.sql.SQLException- Specified by:
updateObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateObject
public void updateObject(java.lang.String columnLabel, java.lang.Object x, java.sql.SQLType targetSqlType, int scaleOrLength) throws java.sql.SQLException- Specified by:
updateObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateObject
public void updateObject(int columnIndex, java.lang.Object x, java.sql.SQLType targetSqlType) throws java.sql.SQLException- Specified by:
updateObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateObject
public void updateObject(java.lang.String columnLabel, java.lang.Object x, java.sql.SQLType targetSqlType) throws java.sql.SQLException- Specified by:
updateObjectin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getRowId
public java.sql.RowId getRowId(int columnIndex) throws java.sql.SQLException- Specified by:
getRowIdin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getRowId
public java.sql.RowId getRowId(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getRowIdin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateRowId
public void updateRowId(int columnIndex, java.sql.RowId x) throws java.sql.SQLException- Specified by:
updateRowIdin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateRowId
public void updateRowId(java.lang.String columnName, java.sql.RowId x) throws java.sql.SQLException- Specified by:
updateRowIdin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getHoldability
public int getHoldability() throws java.sql.SQLException- Specified by:
getHoldabilityin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
isClosed
public boolean isClosed() throws java.sql.SQLException- Specified by:
isClosedin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNString
public void updateNString(int columnIndex, java.lang.String nString) throws java.sql.SQLException- Specified by:
updateNStringin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNString
public void updateNString(java.lang.String columnName, java.lang.String nString) throws java.sql.SQLException- Specified by:
updateNStringin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNClob
public void updateNClob(int columnIndex, java.sql.NClob nClob) throws java.sql.SQLException- Specified by:
updateNClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNClob
public void updateNClob(java.lang.String columnName, java.sql.NClob nClob) throws java.sql.SQLException- Specified by:
updateNClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNClob
public void updateNClob(int columnIndex, java.io.Reader reader) throws java.sql.SQLException- Specified by:
updateNClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNClob
public void updateNClob(java.lang.String columnName, java.io.Reader reader) throws java.sql.SQLException- Specified by:
updateNClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNClob
public void updateNClob(int columnIndex, java.io.Reader reader, long length) throws java.sql.SQLException- Specified by:
updateNClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNClob
public void updateNClob(java.lang.String columnName, java.io.Reader reader, long length) throws java.sql.SQLException- Specified by:
updateNClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getNClob
public java.sql.NClob getNClob(int columnIndex) throws java.sql.SQLException- Specified by:
getNClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getNClob
public java.sql.NClob getNClob(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getNClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBlob
public void updateBlob(int columnIndex, java.io.InputStream inputStream, long length) throws java.sql.SQLException- Specified by:
updateBlobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBlob
public void updateBlob(java.lang.String columnName, java.io.InputStream inputStream, long length) throws java.sql.SQLException- Specified by:
updateBlobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBlob
public void updateBlob(int columnIndex, java.io.InputStream inputStream) throws java.sql.SQLException- Specified by:
updateBlobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBlob
public void updateBlob(java.lang.String columnName, java.io.InputStream inputStream) throws java.sql.SQLException- Specified by:
updateBlobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateClob
public void updateClob(int columnIndex, java.io.Reader reader, long length) throws java.sql.SQLException- Specified by:
updateClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateClob
public void updateClob(java.lang.String columnName, java.io.Reader reader, long length) throws java.sql.SQLException- Specified by:
updateClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateClob
public void updateClob(int columnIndex, java.io.Reader reader) throws java.sql.SQLException- Specified by:
updateClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateClob
public void updateClob(java.lang.String columnName, java.io.Reader reader) throws java.sql.SQLException- Specified by:
updateClobin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getSQLXML
public java.sql.SQLXML getSQLXML(int columnIndex) throws java.sql.SQLException- Specified by:
getSQLXMLin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getSQLXML
public java.sql.SQLXML getSQLXML(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getSQLXMLin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateSQLXML
public void updateSQLXML(int columnIndex, java.sql.SQLXML xmlObject) throws java.sql.SQLException- Specified by:
updateSQLXMLin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateSQLXML
public void updateSQLXML(java.lang.String columnName, java.sql.SQLXML xmlObject) throws java.sql.SQLException- Specified by:
updateSQLXMLin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getNString
public java.lang.String getNString(int columnIndex) throws java.sql.SQLException- Specified by:
getNStringin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getNString
public java.lang.String getNString(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getNStringin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getNCharacterStream
public java.io.Reader getNCharacterStream(int columnIndex) throws java.sql.SQLException- Specified by:
getNCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
getNCharacterStream
public java.io.Reader getNCharacterStream(java.lang.String columnName) throws java.sql.SQLException- Specified by:
getNCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNCharacterStream
public void updateNCharacterStream(int columnIndex, java.io.Reader x, int length) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
updateNCharacterStream
public void updateNCharacterStream(java.lang.String columnName, java.io.Reader x, int length) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
updateNCharacterStream
public void updateNCharacterStream(int columnIndex, java.io.Reader x) throws java.sql.SQLException- Specified by:
updateNCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNCharacterStream
public void updateNCharacterStream(java.lang.String columnName, java.io.Reader x) throws java.sql.SQLException- Specified by:
updateNCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNCharacterStream
public void updateNCharacterStream(int columnIndex, java.io.Reader x, long length) throws java.sql.SQLException- Specified by:
updateNCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateNCharacterStream
public void updateNCharacterStream(java.lang.String columnName, java.io.Reader x, long length) throws java.sql.SQLException- Specified by:
updateNCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateCharacterStream
public void updateCharacterStream(int columnIndex, java.io.Reader reader, long length) throws java.sql.SQLException- Specified by:
updateCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateCharacterStream
public void updateCharacterStream(java.lang.String columnName, java.io.Reader reader, long length) throws java.sql.SQLException- Specified by:
updateCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateCharacterStream
public void updateCharacterStream(int columnIndex, java.io.Reader reader) throws java.sql.SQLException- Specified by:
updateCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateCharacterStream
public void updateCharacterStream(java.lang.String columnName, java.io.Reader reader) throws java.sql.SQLException- Specified by:
updateCharacterStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBinaryStream
public void updateBinaryStream(int columnIndex, java.io.InputStream inputStream, long length) throws java.sql.SQLException- Specified by:
updateBinaryStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBinaryStream
public void updateBinaryStream(java.lang.String columnName, java.io.InputStream inputStream, long length) throws java.sql.SQLException- Specified by:
updateBinaryStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBinaryStream
public void updateBinaryStream(int columnIndex, java.io.InputStream inputStream) throws java.sql.SQLException- Specified by:
updateBinaryStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateBinaryStream
public void updateBinaryStream(java.lang.String columnName, java.io.InputStream inputStream) throws java.sql.SQLException- Specified by:
updateBinaryStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateAsciiStream
public void updateAsciiStream(int columnIndex, java.io.InputStream inputStream, long length) throws java.sql.SQLException- Specified by:
updateAsciiStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateAsciiStream
public void updateAsciiStream(java.lang.String columnName, java.io.InputStream inputStream, long length) throws java.sql.SQLException- Specified by:
updateAsciiStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateAsciiStream
public void updateAsciiStream(int columnIndex, java.io.InputStream inputStream) throws java.sql.SQLException- Specified by:
updateAsciiStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
updateAsciiStream
public void updateAsciiStream(java.lang.String columnName, java.io.InputStream inputStream) throws java.sql.SQLException- Specified by:
updateAsciiStreamin interfacejava.sql.ResultSet- Throws:
java.sql.SQLException
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException- Specified by:
isWrapperForin interfacejava.sql.Wrapper- Throws:
java.sql.SQLException
-
unwrap
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException- Specified by:
unwrapin interfacejava.sql.Wrapper- Throws:
java.sql.SQLException
-
getDefaultCalendar
private java.util.Calendar getDefaultCalendar()
-
-