org.postgresql.jdbc2
Class AbstractJdbc2Statement

java.lang.Object
  extended by org.postgresql.jdbc2.AbstractJdbc2Statement
All Implemented Interfaces:
java.sql.Statement, BaseStatement, PGStatement
Direct Known Subclasses:
AbstractJdbc3Statement

public abstract class AbstractJdbc2Statement
extends java.lang.Object
implements BaseStatement

This class defines methods of the jdbc2 specification. The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2Statement


Nested Class Summary
 class AbstractJdbc2Statement.StatementResultHandler
           
 
Field Summary
protected  boolean adjustIndex
          used to differentiate between new function call logic and old function call logic will be set to true if the server is < 8.1 or if we are using v2 protocol There is an exception to this where we are using v3, and the call does not have an out parameter before the call
protected  java.util.ArrayList batchParameters
           
protected  java.util.ArrayList batchStatements
           
protected  java.lang.Object[] callResult
           
protected  int concurrency
           
protected  BaseConnection connection
           
protected  int fetchdirection
           
protected  int fetchSize
          Number of rows to get in a batch.
protected  ResultWrapper firstUnclosedResult
          The first unclosed result.
protected  boolean isClosed
           
protected  Query lastSimpleQuery
           
protected  int m_prepareThreshold
           
protected  int m_useCount
           
protected  int maxfieldSize
           
protected  int maxrows
          Maximum number of rows to return, 0 = unlimited
protected  boolean outParmBeforeFunc
           
protected  ParameterList preparedParameters
           
protected  Query preparedQuery
           
protected  boolean replaceProcessingEnabled
           
protected  ResultWrapper result
          The current results.
protected  int resultsettype
           
protected  int timeout
          Timeout (in seconds) for a query (not used)
protected  java.sql.SQLWarning warnings
          The warnings chain.
 
Fields inherited from interface org.postgresql.PGStatement
DATE_NEGATIVE_INFINITY, DATE_POSITIVE_INFINITY
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Constructor Summary
AbstractJdbc2Statement(AbstractJdbc2Connection c, int rsType, int rsConcurrency)
           
AbstractJdbc2Statement(AbstractJdbc2Connection connection, java.lang.String sql, boolean isCallable, int rsType, int rsConcurrency)
           
 
Method Summary
 void addBatch()
           
 void addBatch(java.lang.String p_sql)
           
 void addWarning(java.sql.SQLWarning warn)
          This adds a warning to the warning chain.
 void cancel()
           
protected  void checkClosed()
           
protected  void checkIndex(int parameterIndex, int type1, int type2, java.lang.String getName)
          helperfunction for the getXXX calls to check isFunction and index == 1 Compare BOTH type fields against the return type.
protected  void checkIndex(int parameterIndex, int type, java.lang.String getName)
          helperfunction for the getXXX calls to check isFunction and index == 1
 void clearBatch()
           
 void clearParameters()
           
 void clearWarnings()
           
 void close()
           
 java.sql.ResultSet createDriverResultSet(Field[] fields, java.util.Vector tuples)
          Create a synthetic resultset from data provided by the driver.
abstract  java.sql.ResultSet createResultSet(Query originalQuery, Field[] fields, java.util.Vector tuples, ResultCursor cursor)
          Create a resultset from data retrieved from the server.
protected static java.lang.String escapeFunction(java.lang.String functionName, java.lang.String args, boolean stdStrings)
          generate sql for escaped functions
 boolean execute()
           
protected  void execute(Query queryToExecute, ParameterList queryParameters, int flags)
           
 boolean execute(java.lang.String p_sql)
           
 int[] executeBatch()
           
 java.sql.ResultSet executeQuery()
           
 java.sql.ResultSet executeQuery(java.lang.String p_sql)
           
 int executeUpdate()
           
 int executeUpdate(java.lang.String p_sql)
           
 boolean executeWithFlags(int flags)
          Execute a prepared query, passing additional query flags.
 boolean executeWithFlags(java.lang.String p_sql, int flags)
          Execute a query, passing additional query flags.
protected  void finalize()
          This finalizer ensures that statements that have allocated server-side resources free them when they become unreferenced.
 java.sql.Array getArray(int i)
           
 java.math.BigDecimal getBigDecimal(int parameterIndex)
           
 java.math.BigDecimal getBigDecimal(int parameterIndex, int scale)
           
 java.sql.Blob getBlob(int i)
           
 boolean getBoolean(int parameterIndex)
           
 byte getByte(int parameterIndex)
           
 byte[] getBytes(int parameterIndex)
           
 java.sql.Clob getClob(int i)
           
 java.sql.Connection getConnection()
           
 java.sql.Date getDate(int parameterIndex)
           
 java.sql.Date getDate(int i, java.util.Calendar cal)
           
 double getDouble(int parameterIndex)
           
 int getFetchDirection()
           
 java.lang.String getFetchingCursorName()
           
 int getFetchSize()
           
 float getFloat(int parameterIndex)
           
 int getInsertedOID()
           
 int getInt(int parameterIndex)
           
 long getLastOID()
          Returns the Last inserted/updated oid.
 long getLong(int parameterIndex)
           
 int getMaxFieldSize()
           
 int getMaxRows()
           
 java.sql.ResultSetMetaData getMetaData()
           
 boolean getMoreResults()
           
 java.lang.Object getObject(int parameterIndex)
           
 java.lang.Object getObjectImpl(int i, java.util.Map map)
           
 BaseConnection getPGConnection()
           
 int getPrepareThreshold()
          Gets the server-side prepare reuse threshold in use for this statement.
 int getQueryTimeout()
           
 java.sql.Ref getRef(int i)
           
 java.sql.ResultSet getResultSet()
           
 int getResultSetConcurrency()
           
 int getResultSetType()
           
 short getShort(int parameterIndex)
           
 java.lang.String getString(int parameterIndex)
           
 java.sql.Time getTime(int parameterIndex)
           
 java.sql.Time getTime(int i, java.util.Calendar cal)
           
 java.sql.Timestamp getTimestamp(int parameterIndex)
           
 java.sql.Timestamp getTimestamp(int i, java.util.Calendar cal)
           
 int getUpdateCount()
           
 java.sql.SQLWarning getWarnings()
           
 boolean isUseServerPrepare()
          Checks if this statement will be executed as a server-prepared statement.
protected static int parseSql(java.lang.String p_sql, int i, java.lang.StringBuffer newsql, boolean stopOnComma, boolean stdStrings)
          parse the given sql from index i, appending it to the gven buffer until we hit an unmatched right parentheses or end of string.
 void registerOutParameter(int parameterIndex, int sqlType, boolean setPreparedParameters)
           
 void registerOutParameter(int parameterIndex, int sqlType, int scale, boolean setPreparedParameters)
           
 void registerOutParameter(int parameterIndex, int sqlType, java.lang.String typeName)
           
protected  java.lang.String replaceProcessing(java.lang.String p_sql)
           
 void setArray(int i, java.sql.Array x)
           
 void setAsciiStream(int parameterIndex, java.io.InputStream x, int length)
           
 void setBigDecimal(int parameterIndex, java.math.BigDecimal x)
           
 void setBinaryStream(int parameterIndex, java.io.InputStream x, int length)
           
 void setBlob(int i, java.sql.Blob x)
           
 void setBoolean(int parameterIndex, boolean x)
           
 void setByte(int parameterIndex, byte x)
           
 void setBytes(int parameterIndex, byte[] x)
           
 void setCharacterStream(int i, java.io.Reader x, int length)
           
 void setClob(int i, java.sql.Clob x)
           
 void setCursorName(java.lang.String name)
           
 void setDate(int parameterIndex, java.sql.Date x)
           
 void setDate(int i, java.sql.Date d, java.util.Calendar cal)
           
 void setDouble(int parameterIndex, double x)
           
 void setEscapeProcessing(boolean enable)
           
 void setFetchDirection(int direction)
           
 void setFetchSize(int rows)
           
 void setFloat(int parameterIndex, float x)
           
 void setInt(int parameterIndex, int x)
           
 void setLong(int parameterIndex, long x)
           
 void setMaxFieldSize(int max)
           
 void setMaxRows(int max)
           
 void setNull(int parameterIndex, int sqlType)
           
 void setNull(int i, int t, java.lang.String s)
           
 void setObject(int parameterIndex, java.lang.Object x)
           
 void setObject(int parameterIndex, java.lang.Object x, int targetSqlType)
           
 void setObject(int parameterIndex, java.lang.Object in, int targetSqlType, int scale)
           
 void setPrepareThreshold(int newThreshold)
          Sets the reuse threshold for using server-prepared statements.
 void setQueryTimeout(int seconds)
           
 void setRef(int i, java.sql.Ref x)
           
 void setShort(int parameterIndex, short x)
           
 void setString(int parameterIndex, java.lang.String x)
           
protected  void setString(int parameterIndex, java.lang.String x, int oid)
           
 void setTime(int parameterIndex, java.sql.Time x)
           
 void setTime(int i, java.sql.Time t, java.util.Calendar cal)
           
 void setTimestamp(int parameterIndex, java.sql.Timestamp x)
           
 void setTimestamp(int i, java.sql.Timestamp t, java.util.Calendar cal)
           
 void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length)
           
 void setUseServerPrepare(boolean flag)
          Turn on the use of prepared statements in the server (server side prepared statements are unrelated to jdbc PreparedStatements) As of build 302, this method is equivalent to setPrepareThreshold(1).
 java.lang.String toString()
           
protected  boolean wantsHoldableResultSet()
           
protected  boolean wantsScrollableResultSet()
           
 boolean wasNull()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.sql.Statement
execute, execute, execute, executeUpdate, executeUpdate, executeUpdate, getGeneratedKeys, getMoreResults, getResultSetHoldability
 

Field Detail

batchStatements

protected java.util.ArrayList batchStatements

batchParameters

protected java.util.ArrayList batchParameters

resultsettype

protected final int resultsettype

concurrency

protected final int concurrency

fetchdirection

protected int fetchdirection

connection

protected BaseConnection connection

warnings

protected java.sql.SQLWarning warnings
The warnings chain.


maxrows

protected int maxrows
Maximum number of rows to return, 0 = unlimited


fetchSize

protected int fetchSize
Number of rows to get in a batch.


timeout

protected int timeout
Timeout (in seconds) for a query (not used)


replaceProcessingEnabled

protected boolean replaceProcessingEnabled

result

protected ResultWrapper result
The current results.


firstUnclosedResult

protected ResultWrapper firstUnclosedResult
The first unclosed result.


adjustIndex

protected boolean adjustIndex
used to differentiate between new function call logic and old function call logic will be set to true if the server is < 8.1 or if we are using v2 protocol There is an exception to this where we are using v3, and the call does not have an out parameter before the call


outParmBeforeFunc

protected boolean outParmBeforeFunc

preparedQuery

protected final Query preparedQuery

preparedParameters

protected final ParameterList preparedParameters

lastSimpleQuery

protected Query lastSimpleQuery

m_prepareThreshold

protected int m_prepareThreshold

m_useCount

protected int m_useCount

callResult

protected java.lang.Object[] callResult

maxfieldSize

protected int maxfieldSize

isClosed

protected boolean isClosed
Constructor Detail

AbstractJdbc2Statement

public AbstractJdbc2Statement(AbstractJdbc2Connection c,
                              int rsType,
                              int rsConcurrency)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

AbstractJdbc2Statement

public AbstractJdbc2Statement(AbstractJdbc2Connection connection,
                              java.lang.String sql,
                              boolean isCallable,
                              int rsType,
                              int rsConcurrency)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

createDriverResultSet

public java.sql.ResultSet createDriverResultSet(Field[] fields,
                                                java.util.Vector tuples)
                                         throws java.sql.SQLException
Description copied from interface: BaseStatement
Create a synthetic resultset from data provided by the driver.

Specified by:
createDriverResultSet in interface BaseStatement
Parameters:
fields - the column metadata for the resultset
tuples - the resultset data
Returns:
the new ResultSet
Throws:
java.sql.SQLException - if something goes wrong

createResultSet

public abstract java.sql.ResultSet createResultSet(Query originalQuery,
                                                   Field[] fields,
                                                   java.util.Vector tuples,
                                                   ResultCursor cursor)
                                            throws java.sql.SQLException
Description copied from interface: BaseStatement
Create a resultset from data retrieved from the server.

Specified by:
createResultSet in interface BaseStatement
Parameters:
originalQuery - the query that generated this resultset; used when dealing with updateable resultsets
fields - the column metadata for the resultset
tuples - the resultset data
cursor - the cursor to use to retrieve more data from the server; if null, no additional data is present.
Returns:
the new ResultSet
Throws:
java.sql.SQLException - if something goes wrong

getPGConnection

public BaseConnection getPGConnection()

getFetchingCursorName

public java.lang.String getFetchingCursorName()

getFetchSize

public int getFetchSize()
Specified by:
getFetchSize in interface java.sql.Statement

wantsScrollableResultSet

protected boolean wantsScrollableResultSet()

wantsHoldableResultSet

protected boolean wantsHoldableResultSet()

executeQuery

public java.sql.ResultSet executeQuery(java.lang.String p_sql)
                                throws java.sql.SQLException
Specified by:
executeQuery in interface java.sql.Statement
Throws:
java.sql.SQLException

executeQuery

public java.sql.ResultSet executeQuery()
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate(java.lang.String p_sql)
                  throws java.sql.SQLException
Specified by:
executeUpdate in interface java.sql.Statement
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

execute

public boolean execute(java.lang.String p_sql)
                throws java.sql.SQLException
Specified by:
execute in interface java.sql.Statement
Throws:
java.sql.SQLException

executeWithFlags

public boolean executeWithFlags(java.lang.String p_sql,
                                int flags)
                         throws java.sql.SQLException
Description copied from interface: BaseStatement
Execute a query, passing additional query flags.

Specified by:
executeWithFlags in interface BaseStatement
Parameters:
p_sql - the query to execute
flags - additional QueryExecutor flags for execution; these are bitwise-ORed into the default flags.
Throws:
java.sql.SQLException - if something goes wrong.

execute

public boolean execute()
                throws java.sql.SQLException
Throws:
java.sql.SQLException

executeWithFlags

public boolean executeWithFlags(int flags)
                         throws java.sql.SQLException
Description copied from interface: BaseStatement
Execute a prepared query, passing additional query flags.

Specified by:
executeWithFlags in interface BaseStatement
Parameters:
flags - additional QueryExecutor flags for execution; these are bitwise-ORed into the default flags.
Throws:
java.sql.SQLException - if something goes wrong.

execute

protected void execute(Query queryToExecute,
                       ParameterList queryParameters,
                       int flags)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

setCursorName

public void setCursorName(java.lang.String name)
                   throws java.sql.SQLException
Specified by:
setCursorName in interface java.sql.Statement
Throws:
java.sql.SQLException

getUpdateCount

public int getUpdateCount()
                   throws java.sql.SQLException
Specified by:
getUpdateCount in interface java.sql.Statement
Throws:
java.sql.SQLException

getMoreResults

public boolean getMoreResults()
                       throws java.sql.SQLException
Specified by:
getMoreResults in interface java.sql.Statement
Throws:
java.sql.SQLException

getMaxRows

public int getMaxRows()
               throws java.sql.SQLException
Specified by:
getMaxRows in interface java.sql.Statement
Throws:
java.sql.SQLException

setMaxRows

public void setMaxRows(int max)
                throws java.sql.SQLException
Specified by:
setMaxRows in interface java.sql.Statement
Throws:
java.sql.SQLException

setEscapeProcessing

public void setEscapeProcessing(boolean enable)
                         throws java.sql.SQLException
Specified by:
setEscapeProcessing in interface java.sql.Statement
Throws:
java.sql.SQLException

getQueryTimeout

public int getQueryTimeout()
                    throws java.sql.SQLException
Specified by:
getQueryTimeout in interface java.sql.Statement
Throws:
java.sql.SQLException

setQueryTimeout

public void setQueryTimeout(int seconds)
                     throws java.sql.SQLException
Specified by:
setQueryTimeout in interface java.sql.Statement
Throws:
java.sql.SQLException

addWarning

public void addWarning(java.sql.SQLWarning warn)
This adds a warning to the warning chain.

Parameters:
warn - warning to add

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
Specified by:
getWarnings in interface java.sql.Statement
Throws:
java.sql.SQLException

getMaxFieldSize

public int getMaxFieldSize()
                    throws java.sql.SQLException
Specified by:
getMaxFieldSize in interface java.sql.Statement
Throws:
java.sql.SQLException

setMaxFieldSize

public void setMaxFieldSize(int max)
                     throws java.sql.SQLException
Specified by:
setMaxFieldSize in interface java.sql.Statement
Throws:
java.sql.SQLException

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
Specified by:
clearWarnings in interface java.sql.Statement
Throws:
java.sql.SQLException

getResultSet

public java.sql.ResultSet getResultSet()
                                throws java.sql.SQLException
Specified by:
getResultSet in interface java.sql.Statement
Throws:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Specified by:
close in interface java.sql.Statement
Throws:
java.sql.SQLException

finalize

protected void finalize()
This finalizer ensures that statements that have allocated server-side resources free them when they become unreferenced.

Overrides:
finalize in class java.lang.Object

replaceProcessing

protected java.lang.String replaceProcessing(java.lang.String p_sql)
                                      throws java.sql.SQLException
Throws:
java.sql.SQLException

parseSql

protected static int parseSql(java.lang.String p_sql,
                              int i,
                              java.lang.StringBuffer newsql,
                              boolean stopOnComma,
                              boolean stdStrings)
                       throws java.sql.SQLException
parse the given sql from index i, appending it to the gven buffer until we hit an unmatched right parentheses or end of string. When the stopOnComma flag is set we also stop processing when a comma is found in sql text that isn't inside nested parenthesis.

Parameters:
p_sql - the original query text
i - starting position for replacing
newsql - where to write the replaced output
stopOnComma - should we stop after hitting the first comma in sql text?
stdStrings - whether standard_conforming_strings is on
Returns:
the position we stopped processing at
Throws:
java.sql.SQLException

escapeFunction

protected static java.lang.String escapeFunction(java.lang.String functionName,
                                                 java.lang.String args,
                                                 boolean stdStrings)
                                          throws java.sql.SQLException
generate sql for escaped functions

Parameters:
functionName - the escaped function name
args - the arguments for this functin
stdStrings - whether standard_conforming_strings is on
Returns:
the right postgreSql sql
Throws:
java.sql.SQLException

getInsertedOID

public int getInsertedOID()
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getLastOID

public long getLastOID()
                throws java.sql.SQLException
Description copied from interface: PGStatement
Returns the Last inserted/updated oid.

Specified by:
getLastOID in interface PGStatement
Returns:
OID of last insert
Throws:
java.sql.SQLException

setNull

public void setNull(int parameterIndex,
                    int sqlType)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setBoolean

public void setBoolean(int parameterIndex,
                       boolean x)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

setByte

public void setByte(int parameterIndex,
                    byte x)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setShort

public void setShort(int parameterIndex,
                     short x)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setInt

public void setInt(int parameterIndex,
                   int x)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

setLong

public void setLong(int parameterIndex,
                    long x)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setFloat

public void setFloat(int parameterIndex,
                     float x)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setDouble

public void setDouble(int parameterIndex,
                      double x)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setBigDecimal

public void setBigDecimal(int parameterIndex,
                          java.math.BigDecimal x)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

setString

public void setString(int parameterIndex,
                      java.lang.String x)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setString

protected void setString(int parameterIndex,
                         java.lang.String x,
                         int oid)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setBytes

public void setBytes(int parameterIndex,
                     byte[] x)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setDate

public void setDate(int parameterIndex,
                    java.sql.Date x)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setTime

public void setTime(int parameterIndex,
                    java.sql.Time x)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setTimestamp

public void setTimestamp(int parameterIndex,
                         java.sql.Timestamp x)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

setAsciiStream

public void setAsciiStream(int parameterIndex,
                           java.io.InputStream x,
                           int length)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

setUnicodeStream

public void setUnicodeStream(int parameterIndex,
                             java.io.InputStream x,
                             int length)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

setBinaryStream

public void setBinaryStream(int parameterIndex,
                            java.io.InputStream x,
                            int length)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

clearParameters

public void clearParameters()
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

setObject

public void setObject(int parameterIndex,
                      java.lang.Object in,
                      int targetSqlType,
                      int scale)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setObject

public void setObject(int parameterIndex,
                      java.lang.Object x,
                      int targetSqlType)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setObject

public void setObject(int parameterIndex,
                      java.lang.Object x)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType,
                                 boolean setPreparedParameters)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType,
                                 int scale,
                                 boolean setPreparedParameters)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

wasNull

public boolean wasNull()
                throws java.sql.SQLException
Throws:
java.sql.SQLException

getString

public java.lang.String getString(int parameterIndex)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getBoolean

public boolean getBoolean(int parameterIndex)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getByte

public byte getByte(int parameterIndex)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

getShort

public short getShort(int parameterIndex)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

getInt

public int getInt(int parameterIndex)
           throws java.sql.SQLException
Throws:
java.sql.SQLException

getLong

public long getLong(int parameterIndex)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

getFloat

public float getFloat(int parameterIndex)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

getDouble

public double getDouble(int parameterIndex)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

getBigDecimal

public java.math.BigDecimal getBigDecimal(int parameterIndex,
                                          int scale)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getBytes

public byte[] getBytes(int parameterIndex)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

getDate

public java.sql.Date getDate(int parameterIndex)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getTime

public java.sql.Time getTime(int parameterIndex)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getTimestamp

public java.sql.Timestamp getTimestamp(int parameterIndex)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

getObject

public java.lang.Object getObject(int parameterIndex)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

checkIndex

protected void checkIndex(int parameterIndex,
                          int type1,
                          int type2,
                          java.lang.String getName)
                   throws java.sql.SQLException
helperfunction for the getXXX calls to check isFunction and index == 1 Compare BOTH type fields against the return type.

Throws:
java.sql.SQLException

checkIndex

protected void checkIndex(int parameterIndex,
                          int type,
                          java.lang.String getName)
                   throws java.sql.SQLException
helperfunction for the getXXX calls to check isFunction and index == 1

Throws:
java.sql.SQLException

setPrepareThreshold

public void setPrepareThreshold(int newThreshold)
                         throws java.sql.SQLException
Description copied from interface: PGStatement
Sets the reuse threshold for using server-prepared statements.

If threshold is a non-zero value N, the Nth and subsequent reuses of a PreparedStatement will use server-side prepare.

If threshold is zero, server-side prepare will not be used.

The reuse threshold is only used by PreparedStatement and CallableStatement objects; it is ignored for plain Statements.

Specified by:
setPrepareThreshold in interface PGStatement
Parameters:
newThreshold - the new threshold for this statement
Throws:
java.sql.SQLException - if an exception occurs while changing the threshold

getPrepareThreshold

public int getPrepareThreshold()
Description copied from interface: PGStatement
Gets the server-side prepare reuse threshold in use for this statement.

Specified by:
getPrepareThreshold in interface PGStatement
Returns:
the current threshold
See Also:
PGStatement.setPrepareThreshold(int)

setUseServerPrepare

public void setUseServerPrepare(boolean flag)
                         throws java.sql.SQLException
Description copied from interface: PGStatement
Turn on the use of prepared statements in the server (server side prepared statements are unrelated to jdbc PreparedStatements) As of build 302, this method is equivalent to setPrepareThreshold(1).

Specified by:
setUseServerPrepare in interface PGStatement
Throws:
java.sql.SQLException

isUseServerPrepare

public boolean isUseServerPrepare()
Description copied from interface: PGStatement
Checks if this statement will be executed as a server-prepared statement. A return value of true indicates that the next execution of the statement will be done as a server-prepared statement, assuming the underlying protocol supports it.

Specified by:
isUseServerPrepare in interface PGStatement
Returns:
true if the next reuse of this statement will use a server-prepared statement

checkClosed

protected void checkClosed()
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

addBatch

public void addBatch(java.lang.String p_sql)
              throws java.sql.SQLException
Specified by:
addBatch in interface java.sql.Statement
Throws:
java.sql.SQLException

clearBatch

public void clearBatch()
                throws java.sql.SQLException
Specified by:
clearBatch in interface java.sql.Statement
Throws:
java.sql.SQLException

executeBatch

public int[] executeBatch()
                   throws java.sql.SQLException
Specified by:
executeBatch in interface java.sql.Statement
Throws:
java.sql.SQLException

cancel

public void cancel()
            throws java.sql.SQLException
Specified by:
cancel in interface java.sql.Statement
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Specified by:
getConnection in interface java.sql.Statement
Throws:
java.sql.SQLException

getFetchDirection

public int getFetchDirection()
Specified by:
getFetchDirection in interface java.sql.Statement

getResultSetConcurrency

public int getResultSetConcurrency()
Specified by:
getResultSetConcurrency in interface java.sql.Statement

getResultSetType

public int getResultSetType()
Specified by:
getResultSetType in interface java.sql.Statement

setFetchDirection

public void setFetchDirection(int direction)
                       throws java.sql.SQLException
Specified by:
setFetchDirection in interface java.sql.Statement
Throws:
java.sql.SQLException

setFetchSize

public void setFetchSize(int rows)
                  throws java.sql.SQLException
Specified by:
setFetchSize in interface java.sql.Statement
Throws:
java.sql.SQLException

addBatch

public void addBatch()
              throws java.sql.SQLException
Throws:
java.sql.SQLException

getMetaData

public java.sql.ResultSetMetaData getMetaData()
                                       throws java.sql.SQLException
Throws:
java.sql.SQLException

setArray

public void setArray(int i,
                     java.sql.Array x)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setBlob

public void setBlob(int i,
                    java.sql.Blob x)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setCharacterStream

public void setCharacterStream(int i,
                               java.io.Reader x,
                               int length)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

setClob

public void setClob(int i,
                    java.sql.Clob x)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setNull

public void setNull(int i,
                    int t,
                    java.lang.String s)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setRef

public void setRef(int i,
                   java.sql.Ref x)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

setDate

public void setDate(int i,
                    java.sql.Date d,
                    java.util.Calendar cal)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setTime

public void setTime(int i,
                    java.sql.Time t,
                    java.util.Calendar cal)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setTimestamp

public void setTimestamp(int i,
                         java.sql.Timestamp t,
                         java.util.Calendar cal)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getArray

public java.sql.Array getArray(int i)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getBigDecimal

public java.math.BigDecimal getBigDecimal(int parameterIndex)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getBlob

public java.sql.Blob getBlob(int i)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getClob

public java.sql.Clob getClob(int i)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getObjectImpl

public java.lang.Object getObjectImpl(int i,
                                      java.util.Map map)
                               throws java.sql.SQLException
Throws:
java.sql.SQLException

getRef

public java.sql.Ref getRef(int i)
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getDate

public java.sql.Date getDate(int i,
                             java.util.Calendar cal)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getTime

public java.sql.Time getTime(int i,
                             java.util.Calendar cal)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getTimestamp

public java.sql.Timestamp getTimestamp(int i,
                                       java.util.Calendar cal)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType,
                                 java.lang.String typeName)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException