@NotThreadSafe
public class PreparedStatement
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
clearParameters()
Clears the parameters.
|
ResultSet |
execute()
Executes the statement in this
PreparedStatement object. |
PreparedStatement |
set(int i,
Value value)
Sets the i-th parameter to the specified
Value . |
PreparedStatement |
set(java.lang.String name,
Value value)
Sets the parameter for all occurrences of name to the specified
Value . |
PreparedStatement |
setBigInt(int i,
long value)
Sets the i-th parameter to the specified BigIng value.
|
PreparedStatement |
setBigInt(java.lang.String name,
long value)
Sets the parameter for all occurrences of name to the specified BigInt value.
|
PreparedStatement |
setBlob(int i,
byte[] value)
Sets the i-th parameter to the specified Blob value.
|
PreparedStatement |
setBlob(int i,
java.nio.ByteBuffer value)
Sets the i-th parameter to the specified Blob value.
|
PreparedStatement |
setBlob(java.lang.String name,
byte[] value)
Sets the parameter for all occurrences of name to the specified Blob value.
|
PreparedStatement |
setBlob(java.lang.String name,
java.nio.ByteBuffer value)
Sets the parameter for all occurrences of name to the specified Blob value.
|
PreparedStatement |
setBoolean(int i,
boolean value)
Sets the i-th parameter to the specified Boolean value.
|
PreparedStatement |
setBoolean(java.lang.String name,
boolean value)
Sets the parameter for all occurrences of name to the specified Boolean value.
|
PreparedStatement |
setDouble(int i,
double value)
Sets the i-th parameter to the specified Double value.
|
PreparedStatement |
setDouble(java.lang.String name,
double value)
Sets the parameter for all occurrences of name to the specified Double value.
|
PreparedStatement |
setFloat(int i,
float value)
Sets the i-th parameter to the specified Float value.
|
PreparedStatement |
setFloat(java.lang.String name,
float value)
Sets the parameter for all occurrences of name to the specified Float value.
|
PreparedStatement |
setInt(int i,
int value)
Sets the i-th parameter to the specified Int value.
|
PreparedStatement |
setInt(java.lang.String name,
int value)
Sets the parameter for all occurrences of name to the specified Int value.
|
PreparedStatement |
setNull(int i)
Sets the i-th parameter to a null value.
|
PreparedStatement |
setNull(java.lang.String name)
Sets the parameter for all occurrences of name to a null value.
|
PreparedStatement |
setText(int i,
java.lang.String value)
Sets the i-th parameter to the specified Text value.
|
PreparedStatement |
setText(java.lang.String name,
java.lang.String value)
Sets the parameter for all occurrences of name to the specified Text value.
|
public PreparedStatement set(int i, Value value)
Value
.i
- the position of the bind markervalue
- a value to bindpublic PreparedStatement setBoolean(int i, boolean value)
i
- the position of the bind markervalue
- a Boolean value to bindpublic PreparedStatement setInt(int i, int value)
i
- the position of the bind markervalue
- an Int value to bindpublic PreparedStatement setBigInt(int i, long value)
i
- the position of the bind markervalue
- a BigIng value to bindpublic PreparedStatement setFloat(int i, float value)
i
- the position of the bind markervalue
- a Float value to bindpublic PreparedStatement setDouble(int i, double value)
i
- the position of the bind markervalue
- a Double value to bindpublic PreparedStatement setText(int i, @Nullable java.lang.String value)
i
- the position of the bind markervalue
- a Text value to bindpublic PreparedStatement setBlob(int i, @Nullable java.nio.ByteBuffer value)
i
- the position of the bind markervalue
- a Blob value to bindpublic PreparedStatement setBlob(int i, @Nullable byte[] value)
i
- the position of the bind markervalue
- a Blob value to bindpublic PreparedStatement setNull(int i)
i
- the position of the bind markerpublic PreparedStatement set(java.lang.String name, Value value)
Value
.name
- the name of the bind markervalue
- a value to bindpublic PreparedStatement setBoolean(java.lang.String name, boolean value)
name
- the name of the bind markervalue
- a Boolean value to bindpublic PreparedStatement setInt(java.lang.String name, int value)
name
- the name of the bind markervalue
- an Int value to bindpublic PreparedStatement setBigInt(java.lang.String name, long value)
name
- the name of the bind markervalue
- a BigInt value to bindpublic PreparedStatement setFloat(java.lang.String name, float value)
name
- the name of the bind markervalue
- a Float value to bindpublic PreparedStatement setDouble(java.lang.String name, double value)
name
- the name of the bind markervalue
- a Double value to bindpublic PreparedStatement setText(java.lang.String name, @Nullable java.lang.String value)
name
- the name of the bind markervalue
- a Text value to bindpublic PreparedStatement setBlob(java.lang.String name, @Nullable java.nio.ByteBuffer value)
name
- the name of the bind markervalue
- a Blob value to bindpublic PreparedStatement setBlob(java.lang.String name, @Nullable byte[] value)
name
- the name of the bind markervalue
- a Blob value to bindpublic PreparedStatement setNull(java.lang.String name)
name
- the name of the bind markerpublic void clearParameters()
public ResultSet execute()
PreparedStatement
object.ResultSet
object that contains the data produced by the queryTransactionRetryableException
- if the transaction operation execution fails due to
retryable faults (e.g., a transaction conflict). You can retry the transaction from the
beginning.UnknownTransactionStatusException
- if the transaction status (committed or aborted) is
unknown when executing the COMMIT statementSqlException
- if the transaction operation execution fails due to transient or
nontransient faults. You can try retrying the transaction from the beginning, but the
transaction may still fail if the cause is nontranient