Provider - the type of the parent to return from each method of this classStatement - the type of the statementpublic interface ParameterProvider<Provider extends ParameterProvider<Provider,Statement>,Statement extends PreparedStatement> extends StatementHolder<Statement>
PreparedStatement and providing methods
to set it up for a sql query.| Modifier and Type | Method and Description |
|---|---|
Provider |
prepare(SqlConsumer<Statement> preparator)
Prepares an instance of
PreparedStatement to be executed. |
Provider |
set(int index,
Object x)
Sets the designated parameter based on the type of the parameter given.
|
Provider |
setArray(int index,
Array x)
Sets the designated parameter to the given
Array. |
Provider |
setAsciiStream(int index,
InputStream x)
Sets the designated parameter to the given
InputStream. |
Provider |
setAsciiStream(int index,
InputStream x,
int length)
Sets the designated parameter to the given
InputStream. |
Provider |
setAsciiStream(int index,
InputStream x,
long length)
Sets the designated parameter to the given
InputStream. |
Provider |
setBigDecimal(int index,
BigDecimal x)
Sets the designated parameter to the given
BigDecimal. |
Provider |
setBinaryStream(int index,
InputStream x)
Sets the designated parameter to the given
InputStream. |
Provider |
setBinaryStream(int index,
InputStream x,
int length)
Sets the designated parameter to the given
InputStream. |
Provider |
setBinaryStream(int index,
InputStream x,
long length)
Sets the designated parameter to the given
InputStream. |
Provider |
setBlob(int index,
Blob x)
Sets the designated parameter to the given
Blob. |
Provider |
setBlob(int index,
InputStream x)
Sets the designated parameter to the given
InputStream. |
Provider |
setBlob(int index,
InputStream x,
long length)
Sets the designated parameter to the given
InputStream. |
Provider |
setBoolean(int index,
boolean x)
Sets the designated parameter to the given
boolean. |
Provider |
setByte(int index,
byte x)
Sets the designated parameter to the given
byte. |
Provider |
setBytes(int index,
byte[] x)
Sets the designated parameter to the given
byte[]. |
Provider |
setCharacterStream(int index,
Reader x)
Sets the designated parameter to the given
Reader. |
Provider |
setCharacterStream(int index,
Reader x,
int length)
Sets the designated parameter to the given
Reader. |
Provider |
setCharacterStream(int index,
Reader x,
long length)
Sets the designated parameter to the given
Reader. |
Provider |
setClob(int index,
Clob x)
Sets the designated parameter to the given
Clob. |
Provider |
setClob(int index,
Reader x)
Sets the designated parameter to the given
Reader. |
Provider |
setClob(int index,
Reader x,
long length)
Sets the designated parameter to the given
Reader. |
Provider |
setDate(int index,
Date x)
Sets the designated parameter to the given
Date. |
Provider |
setDate(int index,
Date x,
Calendar cal)
Sets the designated parameter to the given
Date. |
Provider |
setDouble(int index,
double x)
Sets the designated parameter to the given
double. |
Provider |
setFloat(int index,
float x)
Sets the designated parameter to the given
float. |
Provider |
setInt(int index,
int x)
Sets the designated parameter to the given
int. |
Provider |
setLong(int index,
long x)
Sets the designated parameter to the given
long. |
Provider |
setNCharacterStream(int index,
Reader x)
Sets the designated parameter to the given
Reader. |
Provider |
setNCharacterStream(int index,
Reader x,
long length)
Sets the designated parameter to the given
Reader. |
Provider |
setNClob(int index,
NClob x)
Sets the designated parameter to the given
NClob. |
Provider |
setNClob(int index,
Reader x)
Sets the designated parameter to the given
Reader. |
Provider |
setNClob(int index,
Reader x,
long length)
Sets the designated parameter to the given
Reader. |
Provider |
setNString(int index,
String x)
Sets the designated parameter to the given
String. |
Provider |
setNull(int index,
int sqlType)
Sets the designated parameter to the given
int. |
Provider |
setNull(int index,
int sqlType,
String typeName)
Sets the designated parameter to the given
int. |
Provider |
setObject(int index,
Object x)
Sets the designated parameter to the given
Object. |
Provider |
setObject(int index,
Object x,
int targetSqlType)
Sets the designated parameter to the given
Object. |
Provider |
setObject(int index,
Object x,
int targetSqlType,
int scaleOrLength)
Sets the designated parameter to the given
Object. |
Provider |
setObject(int index,
Object x,
SQLType targetSqlType)
Sets the designated parameter to the given
Object. |
Provider |
setObject(int index,
Object x,
SQLType targetSqlType,
int scaleOrLength)
Sets the designated parameter to the given
Object. |
Provider |
setRef(int index,
Ref x)
Sets the designated parameter to the given
Ref. |
Provider |
setRowId(int index,
RowId x)
Sets the designated parameter to the given
RowId. |
Provider |
setShort(int index,
short x)
Sets the designated parameter to the given
short. |
Provider |
setSQLXML(int index,
SQLXML x)
Sets the designated parameter to the given
SQLXML. |
Provider |
setString(int index,
String x)
Sets the designated parameter to the given
String. |
Provider |
setTime(int index,
Time x)
Sets the designated parameter to the given
Time. |
Provider |
setTime(int index,
Time x,
Calendar cal)
Sets the designated parameter to the given
Time. |
Provider |
setTimestamp(int index,
Timestamp x)
Sets the designated parameter to the given
Timestamp. |
Provider |
setTimestamp(int index,
Timestamp x,
Calendar cal)
Sets the designated parameter to the given
Timestamp. |
Provider |
setURL(int index,
URL x)
Sets the designated parameter to the given
URL. |
Provider |
with(Object... params)
Sets multiple parameters using magic bindings.
|
close, execute, getStatementProvider prepare(SqlConsumer<Statement> preparator)
PreparedStatement to be executed.preparator - an operation to execute on the statementthis for chainingProvider with(Object... params)
See here for the types supported by this method.
params - parameters to setthis for chainingProvider set(int index, Object x)
See here for the types supported by this method.
index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingNullPointerException - if x is nullProvider setArray(int index, Array x)
Array.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setArray(int, Array)Provider setAsciiStream(int index, InputStream x)
InputStream.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setAsciiStream(int, InputStream)Provider setAsciiStream(int index, InputStream x, int length)
InputStream.index - the index of the parameter to set (starting from 1)x - the value to setlength - the number of bytes in the streamthis for chainingPreparedStatement.setAsciiStream(int, InputStream, int)Provider setAsciiStream(int index, InputStream x, long length)
InputStream.index - the index of the parameter to set (starting from 1)x - the value to setlength - the number of bytes in the streamthis for chainingPreparedStatement.setAsciiStream(int, InputStream, long)Provider setBigDecimal(int index, BigDecimal x)
BigDecimal.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setBigDecimal(int, BigDecimal)Provider setBinaryStream(int index, InputStream x)
InputStream.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setBinaryStream(int, InputStream)Provider setBinaryStream(int index, InputStream x, int length)
InputStream.index - the index of the parameter to set (starting from 1)x - the value to setlength - the number of bytes in the streamthis for chainingPreparedStatement.setBinaryStream(int, InputStream, int)Provider setBinaryStream(int index, InputStream x, long length)
InputStream.index - the index of the parameter to set (starting from 1)x - the value to setlength - the number of bytes in the streamthis for chainingPreparedStatement.setBinaryStream(int, InputStream, long)Provider setBlob(int index, Blob x)
Blob.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setBlob(int, Blob)Provider setBlob(int index, InputStream x)
InputStream.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setBlob(int, InputStream)Provider setBlob(int index, InputStream x, long length)
InputStream.index - the index of the parameter to set (starting from 1)x - the value to setlength - the number of bytes in the streamthis for chainingPreparedStatement.setBlob(int, InputStream, long)Provider setBoolean(int index, boolean x)
boolean.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setBoolean(int, boolean)Provider setByte(int index, byte x)
byte.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setByte(int, byte)Provider setBytes(int index, byte[] x)
byte[].index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setBytes(int, byte[])Provider setCharacterStream(int index, Reader x)
Reader.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setCharacterStream(int, Reader)Provider setCharacterStream(int index, Reader x, int length)
Reader.index - the index of the parameter to set (starting from 1)x - the value to setlength - the number of characters in the streamthis for chainingPreparedStatement.setCharacterStream(int, Reader, int)Provider setCharacterStream(int index, Reader x, long length)
Reader.index - the index of the parameter to set (starting from 1)x - the value to setlength - the number of characters in the streamthis for chainingPreparedStatement.setCharacterStream(int, Reader, long)Provider setClob(int index, Clob x)
Clob.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setClob(int, Clob)Provider setClob(int index, Reader x)
Reader.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setClob(int, Reader)Provider setClob(int index, Reader x, long length)
Reader.index - the index of the parameter to set (starting from 1)x - the value to setlength - the number of characters in the streamthis for chainingPreparedStatement.setClob(int, Reader, long)Provider setDate(int index, Date x)
Date.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setDate(int, Date)Provider setDate(int index, Date x, Calendar cal)
Date.index - the index of the parameter to set (starting from 1)x - the value to setcal - the Calendar object the driver will use to construct the datethis for chainingPreparedStatement.setDate(int, Date, Calendar)Provider setDouble(int index, double x)
double.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setDouble(int, double)Provider setFloat(int index, float x)
float.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setFloat(int, float)Provider setInt(int index, int x)
int.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setInt(int, int)Provider setLong(int index, long x)
long.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setLong(int, long)Provider setNCharacterStream(int index, Reader x)
Reader.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setNCharacterStream(int, Reader)Provider setNCharacterStream(int index, Reader x, long length)
Reader.index - the index of the parameter to set (starting from 1)x - the value to setlength - the number of characters in the streamthis for chainingPreparedStatement.setNCharacterStream(int, Reader, long length)Provider setNClob(int index, NClob x)
NClob.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setNClob(int, NClob)Provider setNClob(int index, Reader x)
Reader.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setNClob(int, Reader)Provider setNClob(int index, Reader x, long length)
Reader.index - the index of the parameter to set (starting from 1)x - the value to setlength - the number of characters in the streamthis for chainingPreparedStatement.setNClob(int, Reader, long)Provider setNString(int index, String x)
String.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setNString(int, String)Provider setNull(int index, int sqlType)
int.index - the index of the parameter to set (starting from 1)sqlType - the SQL type code defined in Typesthis for chainingPreparedStatement.setNull(int, int)Provider setNull(int index, int sqlType, String typeName)
int.index - the index of the parameter to set (starting from 1)sqlType - the SQL type code defined in TypestypeName - the fully-qualified name of an SQL user-defined type;
ignored if the parameter is not a user-defined type or REFthis for chainingPreparedStatement.setNull(int, int, String)Provider setObject(int index, Object x)
Object.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setObject(int, Object)Provider setObject(int index, Object x, int targetSqlType)
Object.index - the index of the parameter to set (starting from 1)x - the value to settargetSqlType - the SQL type code defined in Typesthis for chainingPreparedStatement.setObject(int, Object, int)Provider setObject(int index, Object x, int targetSqlType, int scaleOrLength)
Object.index - the index of the parameter to set (starting from 1)x - the value to settargetSqlType - the SQL type code defined in TypesscaleOrLength - for java.sql.Types.DECIMAL
or java.sql.Types.NUMERIC, this is the number of digits
after the decimal point. For Java Object types InputStream
and Reader, this is the length of the data in the stream
or reader. For all other types, this value will be ignored.this for chainingPreparedStatement.setObject(int, Object, int, int)Provider setObject(int index, Object x, SQLType targetSqlType)
Object.index - the index of the parameter to set (starting from 1)x - the value to settargetSqlType - the SQL type code defined in Typesthis for chainingPreparedStatement.setObject(int, Object, SQLType)Provider setObject(int index, Object x, SQLType targetSqlType, int scaleOrLength)
Object.index - the index of the parameter to set (starting from 1)x - the value to settargetSqlType - the SQL type code defined in TypesscaleOrLength - for java.sql.Types.DECIMAL
or java.sql.Types.NUMERIC, this is the number of digits
after the decimal point. For Java Object types InputStream
and Reader, this is the length of the data in the stream
or reader. For all other types, this value will be ignored.this for chainingPreparedStatement.setObject(int, Object, SQLType, int)Provider setRef(int index, Ref x)
Ref.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setRef(int, Ref)Provider setRowId(int index, RowId x)
RowId.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setRowId(int, RowId)Provider setShort(int index, short x)
short.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setShort(int, short)Provider setSQLXML(int index, SQLXML x)
SQLXML.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setSQLXML(int, SQLXML)Provider setString(int index, String x)
String.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setString(int, String)Provider setTime(int index, Time x)
Time.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setTime(int, Time)Provider setTime(int index, Time x, Calendar cal)
Time.index - the index of the parameter to set (starting from 1)x - the value to setcal - the Calendar object the driver will use to construct the datethis for chainingPreparedStatement.setTime(int, Time, Calendar)Provider setTimestamp(int index, Timestamp x)
Timestamp.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setTimestamp(int, Timestamp)Provider setTimestamp(int index, Timestamp x, Calendar cal)
Timestamp.index - the index of the parameter to set (starting from 1)x - the value to setcal - the Calendar object the driver will use to construct the datethis for chainingPreparedStatement.setTimestamp(int, Timestamp, Calendar)Provider setURL(int index, URL x)
URL.index - the index of the parameter to set (starting from 1)x - the value to setthis for chainingPreparedStatement.setURL(int, URL)Copyright © 2019. All rights reserved.