org.postgresql.jdbc2
Class AbstractJdbc2Statement

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

public abstract class AbstractJdbc2Statement
extends 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  ArrayList batchParameters
           
protected  ArrayList batchStatements
           
protected  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  ResultWrapper generatedKeys
          Results returned by a statement that wants generated keys.
protected  boolean isClosed
           
protected  Query lastSimpleQuery
           
protected  SQLWarning lastWarning
          The last warning of the warning chain.
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)
 boolean wantsGeneratedKeysAlways
          Was this PreparedStatement created to return generated keys for every execution? This is set at creation time and never cleared by execution.
protected  boolean wantsGeneratedKeysOnce
          Does the caller of execute/executeUpdate want generated keys for this execution? This is set by Statement methods that have generated keys arguments and cleared after execution is complete.
protected  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, String sql, boolean isCallable, int rsType, int rsConcurrency)
           
 
Method Summary
 void addBatch()
           
 void addBatch(String p_sql)
           
 void addWarning(SQLWarning warn)
          This adds a warning to the warning chain.
protected  void bindLiteral(int paramIndex, String s, int oid)
           
 void cancel()
           
protected  void checkClosed()
           
protected  void checkIndex(int parameterIndex, int type1, int type2, 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, String getName)
          helperfunction for the getXXX calls to check isFunction and index == 1
 void clearBatch()
           
 void clearParameters()
           
 void clearWarnings()
           
 void close()
           
protected  void closeForNextExecution()
           
 ResultSet createDriverResultSet(Field[] fields, Vector tuples)
          Create a synthetic resultset from data provided by the driver.
abstract  ResultSet createResultSet(Query originalQuery, Field[] fields, Vector tuples, ResultCursor cursor)
          Create a resultset from data retrieved from the server.
protected static String escapeFunction(String functionName, String args, boolean stdStrings)
          generate sql for escaped functions
 boolean execute()
           
protected  void execute(Query queryToExecute, ParameterList queryParameters, int flags)
           
 boolean execute(String p_sql)
           
 int[] executeBatch()
           
 ResultSet executeQuery()
           
 ResultSet executeQuery(String p_sql)
           
 int executeUpdate()
           
 int executeUpdate(String p_sql)
           
 boolean executeWithFlags(int flags)
          Execute a prepared query, passing additional query flags.
 boolean executeWithFlags(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.
 Array getArray(int i)
           
 BigDecimal getBigDecimal(int parameterIndex)
           
 BigDecimal getBigDecimal(int parameterIndex, int scale)
           
 Blob getBlob(int i)
           
 boolean getBoolean(int parameterIndex)
           
 byte getByte(int parameterIndex)
           
 byte[] getBytes(int parameterIndex)
           
 Clob getClob(int i)
           
 Connection getConnection()
           
 Date getDate(int parameterIndex)
           
 Date getDate(int i, Calendar cal)
           
 double getDouble(int parameterIndex)
           
 int getFetchDirection()
           
 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()
           
 ResultSetMetaData getMetaData()
           
 boolean getMoreResults()
           
 Object getObject(int parameterIndex)
           
 Object getObjectImpl(int i, Map map)
           
 BaseConnection getPGConnection()
           
 int getPrepareThreshold()
          Gets the server-side prepare reuse threshold in use for this statement.
 int getQueryTimeout()
           
 Ref getRef(int i)
           
 ResultSet getResultSet()
           
 int getResultSetConcurrency()
           
 int getResultSetType()
           
 short getShort(int parameterIndex)
           
 String getString(int parameterIndex)
           
 Time getTime(int parameterIndex)
           
 Time getTime(int i, Calendar cal)
           
 Timestamp getTimestamp(int parameterIndex)
           
 Timestamp getTimestamp(int i, Calendar cal)
           
 int getUpdateCount()
           
 SQLWarning getWarnings()
           
 boolean isUseServerPrepare()
          Checks if this statement will be executed as a server-prepared statement.
protected static int parseSql(String p_sql, int i, 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, String typeName)
           
protected  String replaceProcessing(String p_sql)
           
 void setArray(int i, Array x)
           
 void setAsciiStream(int parameterIndex, InputStream x, int length)
           
 void setBigDecimal(int parameterIndex, BigDecimal x)
           
 void setBinaryStream(int parameterIndex, InputStream x, int length)
           
 void setBlob(int i, Blob x)
           
 void setBoolean(int parameterIndex, boolean x)
           
 void setByte(int parameterIndex, byte x)
           
 void setBytes(int parameterIndex, byte[] x)
           
 void setCharacterStream(int i, Reader x, int length)
           
 void setClob(int i, Clob x)
           
 void setCursorName(String name)
           
 void setDate(int parameterIndex, Date x)
           
 void setDate(int i, Date d, 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, String s)
           
 void setObject(int parameterIndex, Object x)
           
 void setObject(int parameterIndex, Object x, int targetSqlType)
           
 void setObject(int parameterIndex, 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, Ref x)
           
 void setShort(int parameterIndex, short x)
           
 void setString(int parameterIndex, String x)
           
protected  void setString(int parameterIndex, String x, int oid)
           
 void setTime(int parameterIndex, Time x)
           
 void setTime(int i, Time t, Calendar cal)
           
 void setTimestamp(int parameterIndex, Timestamp x)
           
 void setTimestamp(int i, Timestamp t, Calendar cal)
           
 void setUnicodeStream(int parameterIndex, 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).
 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, isClosed, isPoolable, setPoolable
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Field Detail

batchStatements

protected ArrayList batchStatements

batchParameters

protected ArrayList batchParameters

resultsettype

protected final int resultsettype

concurrency

protected final int concurrency

fetchdirection

protected int fetchdirection

wantsGeneratedKeysOnce

protected boolean wantsGeneratedKeysOnce
Does the caller of execute/executeUpdate want generated keys for this execution? This is set by Statement methods that have generated keys arguments and cleared after execution is complete.


wantsGeneratedKeysAlways

public boolean wantsGeneratedKeysAlways
Was this PreparedStatement created to return generated keys for every execution? This is set at creation time and never cleared by execution.


connection

protected BaseConnection connection

warnings

protected SQLWarning warnings
The warnings chain.


lastWarning

protected SQLWarning lastWarning
The last warning of the warning 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.


generatedKeys

protected ResultWrapper generatedKeys
Results returned by a statement that wants generated keys.


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 Object[] callResult

maxfieldSize

protected int maxfieldSize

isClosed

protected boolean isClosed
Constructor Detail

AbstractJdbc2Statement

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

AbstractJdbc2Statement

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

createDriverResultSet

public ResultSet createDriverResultSet(Field[] fields,
                                       Vector tuples)
                                throws 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:
SQLException - if something goes wrong

createResultSet

public abstract ResultSet createResultSet(Query originalQuery,
                                          Field[] fields,
                                          Vector tuples,
                                          ResultCursor cursor)
                                   throws 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:
SQLException - if something goes wrong

getPGConnection

public BaseConnection getPGConnection()

getFetchingCursorName

public String getFetchingCursorName()

getFetchSize

public int getFetchSize()
Specified by:
getFetchSize in interface Statement

wantsScrollableResultSet

protected boolean wantsScrollableResultSet()

wantsHoldableResultSet

protected boolean wantsHoldableResultSet()

executeQuery

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

executeQuery

public ResultSet executeQuery()
                       throws SQLException
Throws:
SQLException

executeUpdate

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

executeUpdate

public int executeUpdate()
                  throws SQLException
Throws:
SQLException

execute

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

executeWithFlags

public boolean executeWithFlags(String p_sql,
                                int flags)
                         throws 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:
SQLException - if something goes wrong.

execute

public boolean execute()
                throws SQLException
Throws:
SQLException

executeWithFlags

public boolean executeWithFlags(int flags)
                         throws 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:
SQLException - if something goes wrong.

closeForNextExecution

protected void closeForNextExecution()
                              throws SQLException
Throws:
SQLException

execute

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

setCursorName

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

getUpdateCount

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

getMoreResults

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

getMaxRows

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

setMaxRows

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

setEscapeProcessing

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

getQueryTimeout

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

setQueryTimeout

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

addWarning

public void addWarning(SQLWarning warn)
This adds a warning to the warning chain. We track the tail of the warning chain as well to avoid O(N) behavior for adding a new warning to an existing chain. Some server functions which RAISE NOTICE (or equivalent) produce a ton of warnings.

Parameters:
warn - warning to add

getWarnings

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

getMaxFieldSize

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

setMaxFieldSize

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

clearWarnings

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

getResultSet

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

close

public void close()
           throws SQLException
Specified by:
close in interface Statement
Throws:
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 Object

replaceProcessing

protected String replaceProcessing(String p_sql)
                            throws SQLException
Throws:
SQLException

parseSql

protected static int parseSql(String p_sql,
                              int i,
                              StringBuffer newsql,
                              boolean stopOnComma,
                              boolean stdStrings)
                       throws 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:
SQLException

escapeFunction

protected static String escapeFunction(String functionName,
                                       String args,
                                       boolean stdStrings)
                                throws 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:
SQLException

getInsertedOID

public int getInsertedOID()
                   throws SQLException
Throws:
SQLException

getLastOID

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

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

setNull

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

setBoolean

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

setByte

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

setShort

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

setInt

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

setLong

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

setFloat

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

setDouble

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

setBigDecimal

public void setBigDecimal(int parameterIndex,
                          BigDecimal x)
                   throws SQLException
Throws:
SQLException

setString

public void setString(int parameterIndex,
                      String x)
               throws SQLException
Throws:
SQLException

setString

protected void setString(int parameterIndex,
                         String x,
                         int oid)
                  throws SQLException
Throws:
SQLException

setBytes

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

setDate

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

setTime

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

setTimestamp

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

setAsciiStream

public void setAsciiStream(int parameterIndex,
                           InputStream x,
                           int length)
                    throws SQLException
Throws:
SQLException

setUnicodeStream

public void setUnicodeStream(int parameterIndex,
                             InputStream x,
                             int length)
                      throws SQLException
Throws:
SQLException

setBinaryStream

public void setBinaryStream(int parameterIndex,
                            InputStream x,
                            int length)
                     throws SQLException
Throws:
SQLException

clearParameters

public void clearParameters()
                     throws SQLException
Throws:
SQLException

setObject

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

setObject

public void setObject(int parameterIndex,
                      Object x,
                      int targetSqlType)
               throws SQLException
Throws:
SQLException

setObject

public void setObject(int parameterIndex,
                      Object x)
               throws SQLException
Throws:
SQLException

registerOutParameter

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

registerOutParameter

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

wasNull

public boolean wasNull()
                throws SQLException
Throws:
SQLException

getString

public String getString(int parameterIndex)
                 throws SQLException
Throws:
SQLException

getBoolean

public boolean getBoolean(int parameterIndex)
                   throws SQLException
Throws:
SQLException

getByte

public byte getByte(int parameterIndex)
             throws SQLException
Throws:
SQLException

getShort

public short getShort(int parameterIndex)
               throws SQLException
Throws:
SQLException

getInt

public int getInt(int parameterIndex)
           throws SQLException
Throws:
SQLException

getLong

public long getLong(int parameterIndex)
             throws SQLException
Throws:
SQLException

getFloat

public float getFloat(int parameterIndex)
               throws SQLException
Throws:
SQLException

getDouble

public double getDouble(int parameterIndex)
                 throws SQLException
Throws:
SQLException

getBigDecimal

public BigDecimal getBigDecimal(int parameterIndex,
                                int scale)
                         throws SQLException
Throws:
SQLException

getBytes

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

getDate

public Date getDate(int parameterIndex)
             throws SQLException
Throws:
SQLException

getTime

public Time getTime(int parameterIndex)
             throws SQLException
Throws:
SQLException

getTimestamp

public Timestamp getTimestamp(int parameterIndex)
                       throws SQLException
Throws:
SQLException

getObject

public Object getObject(int parameterIndex)
                 throws SQLException
Throws:
SQLException

toString

public String toString()
Overrides:
toString in class Object

bindLiteral

protected void bindLiteral(int paramIndex,
                           String s,
                           int oid)
                    throws SQLException
Throws:
SQLException

checkIndex

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

Throws:
SQLException

checkIndex

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

Throws:
SQLException

setPrepareThreshold

public void setPrepareThreshold(int newThreshold)
                         throws 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:
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 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:
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 SQLException
Throws:
SQLException

addBatch

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

clearBatch

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

executeBatch

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

cancel

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

getConnection

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

getFetchDirection

public int getFetchDirection()
Specified by:
getFetchDirection in interface Statement

getResultSetConcurrency

public int getResultSetConcurrency()
Specified by:
getResultSetConcurrency in interface Statement

getResultSetType

public int getResultSetType()
Specified by:
getResultSetType in interface Statement

setFetchDirection

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

setFetchSize

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

addBatch

public void addBatch()
              throws SQLException
Throws:
SQLException

getMetaData

public ResultSetMetaData getMetaData()
                              throws SQLException
Throws:
SQLException

setArray

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

setBlob

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

setCharacterStream

public void setCharacterStream(int i,
                               Reader x,
                               int length)
                        throws SQLException
Throws:
SQLException

setClob

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

setNull

public void setNull(int i,
                    int t,
                    String s)
             throws SQLException
Throws:
SQLException

setRef

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

setDate

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

setTime

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

setTimestamp

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

getArray

public Array getArray(int i)
               throws SQLException
Throws:
SQLException

getBigDecimal

public BigDecimal getBigDecimal(int parameterIndex)
                         throws SQLException
Throws:
SQLException

getBlob

public Blob getBlob(int i)
             throws SQLException
Throws:
SQLException

getClob

public Clob getClob(int i)
             throws SQLException
Throws:
SQLException

getObjectImpl

public Object getObjectImpl(int i,
                            Map map)
                     throws SQLException
Throws:
SQLException

getRef

public Ref getRef(int i)
           throws SQLException
Throws:
SQLException

getDate

public Date getDate(int i,
                    Calendar cal)
             throws SQLException
Throws:
SQLException

getTime

public Time getTime(int i,
                    Calendar cal)
             throws SQLException
Throws:
SQLException

getTimestamp

public Timestamp getTimestamp(int i,
                              Calendar cal)
                       throws SQLException
Throws:
SQLException

registerOutParameter

public void registerOutParameter(int parameterIndex,
                                 int sqlType,
                                 String typeName)
                          throws SQLException
Throws:
SQLException


Copyright © 2013. All Rights Reserved.