Package org.postgresql.jdbc
Class PgPreparedStatement
- java.lang.Object
-
- org.postgresql.jdbc.PgStatement
-
- org.postgresql.jdbc.PgPreparedStatement
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,java.sql.PreparedStatement
,java.sql.Statement
,java.sql.Wrapper
,BaseStatement
,PGStatement
- Direct Known Subclasses:
PgCallableStatement
class PgPreparedStatement extends PgStatement implements java.sql.PreparedStatement
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.postgresql.jdbc.PgStatement
PgStatement.StatementResultHandler
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.TimeZone
defaultTimeZone
protected ParameterList
preparedParameters
protected CachedQuery
preparedQuery
-
Fields inherited from class org.postgresql.jdbc.PgStatement
batchParameters, batchStatements, concurrency, connection, fetchdirection, fetchSize, firstUnclosedResult, generatedKeys, maxFieldSize, maxrows, mPrepareThreshold, replaceProcessingEnabled, result, resultsettype, timeout, wantsGeneratedKeysAlways, wantsGeneratedKeysOnce, warnings
-
Fields inherited from interface org.postgresql.PGStatement
DATE_NEGATIVE_INFINITY, DATE_NEGATIVE_SMALLER_INFINITY, DATE_POSITIVE_INFINITY, DATE_POSITIVE_SMALLER_INFINITY
-
-
Constructor Summary
Constructors Constructor Description PgPreparedStatement(PgConnection connection, java.lang.String sql, int rsType, int rsConcurrency, int rsHoldability)
PgPreparedStatement(PgConnection connection, CachedQuery query, int rsType, int rsConcurrency, int rsHoldability)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBatch()
void
addBatch(java.lang.String sql)
private static java.lang.String
asString(java.sql.Clob in)
protected void
bindBytes(int paramIndex, byte[] b, int oid)
protected void
bindLiteral(int paramIndex, java.lang.String s, int oid)
Note if s is a String it should be escaped by the caller to avoid SQL injection attacks.private void
bindString(int paramIndex, java.lang.String s, int oid)
This version is for values that should turn into strings e.g.private static PSQLException
cannotCastException(java.lang.String fromType, java.lang.String toType)
private static PSQLException
cannotCastException(java.lang.String fromType, java.lang.String toType, java.lang.Exception cause)
private static java.math.BigDecimal
castToBigDecimal(java.lang.Object in, int scale)
private static double
castToDouble(java.lang.Object in)
private static float
castToFloat(java.lang.Object in)
private static int
castToInt(java.lang.Object in)
private static long
castToLong(java.lang.Object in)
private static short
castToShort(java.lang.Object in)
private static java.lang.String
castToString(java.lang.Object in)
void
clearParameters()
void
closeImpl()
This is guaranteed to be called exactly once even in case of concurrentPgStatement.close()
calls.protected long
createBlob(int i, java.io.InputStream inputStream, long length)
java.sql.ParameterMetaData
createParameterMetaData(BaseConnection conn, int[] oids)
boolean
execute()
boolean
execute(java.lang.String sql)
int[]
executeBatch()
long
executeLargeUpdate()
java.sql.ResultSet
executeQuery()
java.sql.ResultSet
executeQuery(java.lang.String sql)
int
executeUpdate()
int
executeUpdate(java.lang.String sql)
boolean
executeWithFlags(int flags)
Execute a prepared query, passing additional query flags.private java.util.Calendar
getDefaultCalendar()
java.sql.ResultSetMetaData
getMetaData()
java.sql.ParameterMetaData
getParameterMetaData()
private int
getStringType()
protected boolean
isOneShotQuery(CachedQuery cachedQuery)
Returns true if query is unlikely to be reused.boolean
isUseServerPrepare()
Checks if this statement will be executed as a server-prepared statement.private java.lang.String
readerToString(java.io.Reader value, int maxLength)
void
setArray(int i, java.sql.Array x)
void
setAsciiStream(int parameterIndex, java.io.InputStream value)
void
setAsciiStream(int parameterIndex, java.io.InputStream x, int length)
void
setAsciiStream(int parameterIndex, java.io.InputStream value, long length)
void
setBigDecimal(int parameterIndex, java.math.BigDecimal x)
void
setBinaryStream(int parameterIndex, java.io.InputStream value)
void
setBinaryStream(int parameterIndex, java.io.InputStream x, int length)
void
setBinaryStream(int parameterIndex, java.io.InputStream value, long length)
void
setBlob(int parameterIndex, java.io.InputStream inputStream)
void
setBlob(int parameterIndex, java.io.InputStream inputStream, long 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)
private void
setByteStreamWriter(int parameterIndex, ByteStreamWriter x)
void
setCharacterStream(int parameterIndex, java.io.Reader value)
void
setCharacterStream(int i, java.io.Reader x, int length)
void
setCharacterStream(int parameterIndex, java.io.Reader value, long length)
private void
setCharacterStreamPost71(int parameterIndex, java.io.InputStream x, int length, java.lang.String encoding)
void
setClob(int parameterIndex, java.io.Reader reader)
void
setClob(int parameterIndex, java.io.Reader reader, long length)
void
setClob(int i, java.sql.Clob x)
void
setDate(int parameterIndex, java.sql.Date x)
void
setDate(int i, java.sql.Date d, java.util.Calendar cal)
private void
setDate(int i, java.time.LocalDate localDate)
void
setDouble(int parameterIndex, double x)
void
setFloat(int parameterIndex, float x)
void
setInt(int parameterIndex, int x)
void
setLong(int parameterIndex, long x)
private void
setMap(int parameterIndex, java.util.Map<?,?> x)
void
setNCharacterStream(int parameterIndex, java.io.Reader value)
void
setNCharacterStream(int parameterIndex, java.io.Reader value, long length)
void
setNClob(int parameterIndex, java.io.Reader reader)
void
setNClob(int parameterIndex, java.io.Reader reader, long length)
void
setNClob(int parameterIndex, java.sql.NClob value)
void
setNString(int parameterIndex, java.lang.String value)
void
setNull(int parameterIndex, int sqlType)
void
setNull(int parameterIndex, int t, java.lang.String typeName)
private void
setNumber(int parameterIndex, java.lang.Number x)
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
setObject(int parameterIndex, java.lang.Object x, java.sql.SQLType targetSqlType)
void
setObject(int parameterIndex, java.lang.Object x, java.sql.SQLType targetSqlType, int scaleOrLength)
private <A> void
setObjectArray(int parameterIndex, A in)
private void
setPGobject(int parameterIndex, PGobject x)
void
setRef(int i, java.sql.Ref x)
void
setRowId(int parameterIndex, java.sql.RowId x)
void
setShort(int parameterIndex, short x)
void
setSQLXML(int parameterIndex, java.sql.SQLXML xmlObject)
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)
private void
setTime(int i, java.time.LocalTime localTime)
void
setTimestamp(int parameterIndex, java.sql.Timestamp x)
void
setTimestamp(int i, java.sql.Timestamp t, java.util.Calendar cal)
private void
setTimestamp(int i, java.time.LocalDateTime localDateTime)
private void
setTimestamp(int i, java.time.OffsetDateTime offsetDateTime)
void
setUnicodeStream(int parameterIndex, java.io.InputStream x, int length)
void
setURL(int parameterIndex, java.net.URL x)
private void
setUuid(int parameterIndex, java.util.UUID uuid)
java.lang.String
toString()
Returns the SQL statement with the current template values substituted.protected void
transformQueriesAndParameters()
-
Methods inherited from class org.postgresql.jdbc.PgStatement
addWarning, cancel, checkClosed, checkCompletion, checkNoResultUpdate, clearBatch, clearWarnings, close, closeForNextExecution, closeOnCompletion, createBatchHandler, createDriverResultSet, createResultSet, execute, execute, execute, execute, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeUpdate, executeUpdate, executeUpdate, executeWithFlags, executeWithFlags, getConnection, getFetchDirection, getFetchingCursorName, getFetchSize, getForceBinaryTransfer, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getLastOID, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getPGConnection, getPrepareThreshold, getQueryTimeout, getQueryTimeoutMs, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getSingleResultSet, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setPrepareThreshold, setQueryTimeout, setQueryTimeoutMs, setUseServerPrepare, unwrap, wantsHoldableResultSet, wantsScrollableResultSet
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.sql.Statement
cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
-
-
-
Field Detail
-
preparedQuery
protected final CachedQuery preparedQuery
-
preparedParameters
protected final ParameterList preparedParameters
-
defaultTimeZone
private java.util.TimeZone defaultTimeZone
-
-
Constructor Detail
-
PgPreparedStatement
PgPreparedStatement(PgConnection connection, java.lang.String sql, int rsType, int rsConcurrency, int rsHoldability) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
PgPreparedStatement
PgPreparedStatement(PgConnection connection, CachedQuery query, int rsType, int rsConcurrency, int rsHoldability) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-
Method Detail
-
executeQuery
public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException
- Specified by:
executeQuery
in interfacejava.sql.Statement
- Overrides:
executeQuery
in classPgStatement
- Throws:
java.sql.SQLException
-
executeQuery
public java.sql.ResultSet executeQuery() throws java.sql.SQLException
- Specified by:
executeQuery
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
- Specified by:
executeUpdate
in interfacejava.sql.Statement
- Overrides:
executeUpdate
in classPgStatement
- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate() throws java.sql.SQLException
- Specified by:
executeUpdate
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
executeLargeUpdate
public long executeLargeUpdate() throws java.sql.SQLException
- Specified by:
executeLargeUpdate
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
execute
public boolean execute(java.lang.String sql) throws java.sql.SQLException
- Specified by:
execute
in interfacejava.sql.Statement
- Overrides:
execute
in classPgStatement
- Throws:
java.sql.SQLException
-
execute
public boolean execute() throws java.sql.SQLException
- Specified by:
execute
in interfacejava.sql.PreparedStatement
- 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 interfaceBaseStatement
- Overrides:
executeWithFlags
in classPgStatement
- Parameters:
flags
- additionalQueryExecutor
flags for execution; these are bitwise-ORed into the default flags.- Returns:
- true if there is a result set
- Throws:
java.sql.SQLException
- if something goes wrong.
-
isOneShotQuery
protected boolean isOneShotQuery(CachedQuery cachedQuery)
Description copied from class:PgStatement
Returns true if query is unlikely to be reused.- Overrides:
isOneShotQuery
in classPgStatement
- Parameters:
cachedQuery
- to check (null if current query)- Returns:
- true if query is unlikely to be reused
-
closeImpl
public void closeImpl() throws java.sql.SQLException
Description copied from class:PgStatement
This is guaranteed to be called exactly once even in case of concurrentPgStatement.close()
calls.- Overrides:
closeImpl
in classPgStatement
- Throws:
java.sql.SQLException
- in case of error
-
setNull
public void setNull(int parameterIndex, int sqlType) throws java.sql.SQLException
- Specified by:
setNull
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setBoolean
public void setBoolean(int parameterIndex, boolean x) throws java.sql.SQLException
- Specified by:
setBoolean
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setByte
public void setByte(int parameterIndex, byte x) throws java.sql.SQLException
- Specified by:
setByte
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setShort
public void setShort(int parameterIndex, short x) throws java.sql.SQLException
- Specified by:
setShort
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setInt
public void setInt(int parameterIndex, int x) throws java.sql.SQLException
- Specified by:
setInt
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setLong
public void setLong(int parameterIndex, long x) throws java.sql.SQLException
- Specified by:
setLong
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setFloat
public void setFloat(int parameterIndex, float x) throws java.sql.SQLException
- Specified by:
setFloat
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setDouble
public void setDouble(int parameterIndex, double x) throws java.sql.SQLException
- Specified by:
setDouble
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setBigDecimal
public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws java.sql.SQLException
- Specified by:
setBigDecimal
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setString
public void setString(int parameterIndex, java.lang.String x) throws java.sql.SQLException
- Specified by:
setString
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
getStringType
private int getStringType()
-
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
- Specified by:
setBytes
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setByteStreamWriter
private void setByteStreamWriter(int parameterIndex, ByteStreamWriter x) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setDate
public void setDate(int parameterIndex, java.sql.Date x) throws java.sql.SQLException
- Specified by:
setDate
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setTime
public void setTime(int parameterIndex, java.sql.Time x) throws java.sql.SQLException
- Specified by:
setTime
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setTimestamp
public void setTimestamp(int parameterIndex, java.sql.Timestamp x) throws java.sql.SQLException
- Specified by:
setTimestamp
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setCharacterStreamPost71
private void setCharacterStreamPost71(int parameterIndex, java.io.InputStream x, int length, java.lang.String encoding) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setAsciiStream
public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws java.sql.SQLException
- Specified by:
setAsciiStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setUnicodeStream
public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws java.sql.SQLException
- Specified by:
setUnicodeStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setBinaryStream
public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws java.sql.SQLException
- Specified by:
setBinaryStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
clearParameters
public void clearParameters() throws java.sql.SQLException
- Specified by:
clearParameters
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setPGobject
private void setPGobject(int parameterIndex, PGobject x) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setMap
private void setMap(int parameterIndex, java.util.Map<?,?> x) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setNumber
private void setNumber(int parameterIndex, java.lang.Number x) 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
- Specified by:
setObject
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setObjectArray
private <A> void setObjectArray(int parameterIndex, A in) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
asString
private static java.lang.String asString(java.sql.Clob in) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
castToInt
private static int castToInt(java.lang.Object in) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
castToShort
private static short castToShort(java.lang.Object in) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
castToLong
private static long castToLong(java.lang.Object in) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
castToFloat
private static float castToFloat(java.lang.Object in) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
castToDouble
private static double castToDouble(java.lang.Object in) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
castToBigDecimal
private static java.math.BigDecimal castToBigDecimal(java.lang.Object in, int scale) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
castToString
private static java.lang.String castToString(java.lang.Object in) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
cannotCastException
private static PSQLException cannotCastException(java.lang.String fromType, java.lang.String toType)
-
cannotCastException
private static PSQLException cannotCastException(java.lang.String fromType, java.lang.String toType, java.lang.Exception cause)
-
setObject
public void setObject(int parameterIndex, java.lang.Object x, int targetSqlType) throws java.sql.SQLException
- Specified by:
setObject
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setObject
public void setObject(int parameterIndex, java.lang.Object x) throws java.sql.SQLException
- Specified by:
setObject
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
toString
public java.lang.String toString()
Returns the SQL statement with the current template values substituted.- Overrides:
toString
in classjava.lang.Object
- Returns:
- SQL statement with the current template values substituted
-
bindLiteral
protected void bindLiteral(int paramIndex, java.lang.String s, int oid) throws java.sql.SQLException
Note if s is a String it should be escaped by the caller to avoid SQL injection attacks. It is not done here for efficiency reasons as most calls to this method do not require escaping as the source of the string is known safe (i.e.Integer.toString()
)- Parameters:
paramIndex
- parameter indexs
- value (the value should already be escaped)oid
- type oid- Throws:
java.sql.SQLException
- if something goes wrong
-
bindBytes
protected void bindBytes(int paramIndex, byte[] b, int oid) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
bindString
private void bindString(int paramIndex, java.lang.String s, int oid) throws java.sql.SQLException
This version is for values that should turn into strings e.g. setString directly calls bindString with no escaping; the per-protocol ParameterList does escaping as needed.- Parameters:
paramIndex
- parameter indexs
- valueoid
- type oid- Throws:
java.sql.SQLException
- if something goes wrong
-
isUseServerPrepare
public boolean isUseServerPrepare()
Description copied from interface:PGStatement
Checks if this statement will be executed as a server-prepared statement. A return value oftrue
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 interfacePGStatement
- Overrides:
isUseServerPrepare
in classPgStatement
- Returns:
- true if the next reuse of this statement will use a server-prepared statement
-
addBatch
public void addBatch(java.lang.String sql) throws java.sql.SQLException
- Specified by:
addBatch
in interfacejava.sql.Statement
- Overrides:
addBatch
in classPgStatement
- Throws:
java.sql.SQLException
-
addBatch
public void addBatch() throws java.sql.SQLException
- Specified by:
addBatch
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
getMetaData
public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException
- Specified by:
getMetaData
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setArray
public void setArray(int i, java.sql.Array x) throws java.sql.SQLException
- Specified by:
setArray
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
createBlob
protected long createBlob(int i, java.io.InputStream inputStream, long length) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setBlob
public void setBlob(int i, java.sql.Blob x) throws java.sql.SQLException
- Specified by:
setBlob
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
readerToString
private java.lang.String readerToString(java.io.Reader value, int maxLength) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setCharacterStream
public void setCharacterStream(int i, java.io.Reader x, int length) throws java.sql.SQLException
- Specified by:
setCharacterStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setClob
public void setClob(int i, java.sql.Clob x) throws java.sql.SQLException
- Specified by:
setClob
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setNull
public void setNull(int parameterIndex, int t, java.lang.String typeName) throws java.sql.SQLException
- Specified by:
setNull
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setRef
public void setRef(int i, java.sql.Ref x) throws java.sql.SQLException
- Specified by:
setRef
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setDate
public void setDate(int i, java.sql.Date d, java.util.Calendar cal) throws java.sql.SQLException
- Specified by:
setDate
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setTime
public void setTime(int i, java.sql.Time t, java.util.Calendar cal) throws java.sql.SQLException
- Specified by:
setTime
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setTimestamp
public void setTimestamp(int i, java.sql.Timestamp t, java.util.Calendar cal) throws java.sql.SQLException
- Specified by:
setTimestamp
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setDate
private void setDate(int i, java.time.LocalDate localDate) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setTime
private void setTime(int i, java.time.LocalTime localTime) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setTimestamp
private void setTimestamp(int i, java.time.LocalDateTime localDateTime) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setTimestamp
private void setTimestamp(int i, java.time.OffsetDateTime offsetDateTime) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
createParameterMetaData
public java.sql.ParameterMetaData createParameterMetaData(BaseConnection conn, int[] oids) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setObject
public void setObject(int parameterIndex, java.lang.Object x, java.sql.SQLType targetSqlType, int scaleOrLength) throws java.sql.SQLException
- Specified by:
setObject
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setObject
public void setObject(int parameterIndex, java.lang.Object x, java.sql.SQLType targetSqlType) throws java.sql.SQLException
- Specified by:
setObject
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setRowId
public void setRowId(int parameterIndex, java.sql.RowId x) throws java.sql.SQLException
- Specified by:
setRowId
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setNString
public void setNString(int parameterIndex, java.lang.String value) throws java.sql.SQLException
- Specified by:
setNString
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setNCharacterStream
public void setNCharacterStream(int parameterIndex, java.io.Reader value, long length) throws java.sql.SQLException
- Specified by:
setNCharacterStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setNCharacterStream
public void setNCharacterStream(int parameterIndex, java.io.Reader value) throws java.sql.SQLException
- Specified by:
setNCharacterStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setCharacterStream
public void setCharacterStream(int parameterIndex, java.io.Reader value, long length) throws java.sql.SQLException
- Specified by:
setCharacterStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setCharacterStream
public void setCharacterStream(int parameterIndex, java.io.Reader value) throws java.sql.SQLException
- Specified by:
setCharacterStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setBinaryStream
public void setBinaryStream(int parameterIndex, java.io.InputStream value, long length) throws java.sql.SQLException
- Specified by:
setBinaryStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setBinaryStream
public void setBinaryStream(int parameterIndex, java.io.InputStream value) throws java.sql.SQLException
- Specified by:
setBinaryStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setAsciiStream
public void setAsciiStream(int parameterIndex, java.io.InputStream value, long length) throws java.sql.SQLException
- Specified by:
setAsciiStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setAsciiStream
public void setAsciiStream(int parameterIndex, java.io.InputStream value) throws java.sql.SQLException
- Specified by:
setAsciiStream
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setNClob
public void setNClob(int parameterIndex, java.sql.NClob value) throws java.sql.SQLException
- Specified by:
setNClob
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setClob
public void setClob(int parameterIndex, java.io.Reader reader, long length) throws java.sql.SQLException
- Specified by:
setClob
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setClob
public void setClob(int parameterIndex, java.io.Reader reader) throws java.sql.SQLException
- Specified by:
setClob
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setBlob
public void setBlob(int parameterIndex, java.io.InputStream inputStream, long length) throws java.sql.SQLException
- Specified by:
setBlob
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setBlob
public void setBlob(int parameterIndex, java.io.InputStream inputStream) throws java.sql.SQLException
- Specified by:
setBlob
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setNClob
public void setNClob(int parameterIndex, java.io.Reader reader, long length) throws java.sql.SQLException
- Specified by:
setNClob
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setNClob
public void setNClob(int parameterIndex, java.io.Reader reader) throws java.sql.SQLException
- Specified by:
setNClob
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setSQLXML
public void setSQLXML(int parameterIndex, java.sql.SQLXML xmlObject) throws java.sql.SQLException
- Specified by:
setSQLXML
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
setUuid
private void setUuid(int parameterIndex, java.util.UUID uuid) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setURL
public void setURL(int parameterIndex, java.net.URL x) throws java.sql.SQLException
- Specified by:
setURL
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
executeBatch
public int[] executeBatch() throws java.sql.SQLException
- Specified by:
executeBatch
in interfacejava.sql.Statement
- Overrides:
executeBatch
in classPgStatement
- Throws:
java.sql.SQLException
-
getDefaultCalendar
private java.util.Calendar getDefaultCalendar()
-
getParameterMetaData
public java.sql.ParameterMetaData getParameterMetaData() throws java.sql.SQLException
- Specified by:
getParameterMetaData
in interfacejava.sql.PreparedStatement
- Throws:
java.sql.SQLException
-
transformQueriesAndParameters
protected void transformQueriesAndParameters() throws java.sql.SQLException
- Overrides:
transformQueriesAndParameters
in classPgStatement
- Throws:
java.sql.SQLException
-
-