T
- the type of the parameterpublic class SqlParameter<T> extends Object
Modifier and Type | Method and Description |
---|---|
static SqlParameter<Byte> |
create(String name,
byte value)
Create a
Byte parameter with the given name and value. |
static SqlParameter<byte[]> |
create(String name,
byte[] value)
Create a
byte[] parameter with the given name and value. |
static SqlParameter<Double> |
create(String name,
double value)
Create a
Double parameter with the given name and value. |
static SqlParameter<Integer> |
create(String name,
int value)
Create a
Integer parameter with the given name and value. |
static SqlParameter<Long> |
create(String name,
long value)
Create a
Long parameter with the given name and value. |
static SqlParameter<String> |
create(String name,
String value)
Create a
String parameter with the given name and value. |
void |
fillStatement(int parameterNumber,
PreparedStatement statement)
This will call the appropriate setXXX method on the statement filling it with the value for the supplied
parameterNumber.
|
String |
getName()
Get the name of the parameter.
|
T |
getValue()
Get the value of the parameter.
|
public static SqlParameter<String> create(String name, String value)
String
parameter with the given name and value.name
- the name of the parametervalue
- the value of the parameterSqlParameter
public static SqlParameter<Integer> create(String name, int value)
Integer
parameter with the given name and value.name
- the name of the parametervalue
- the value of the parameterSqlParameter
public static SqlParameter<Long> create(String name, long value)
Long
parameter with the given name and value.name
- the name of the parametervalue
- the value of the parameterSqlParameter
public static SqlParameter<Double> create(String name, double value)
Double
parameter with the given name and value.name
- the name of the parametervalue
- the value of the parameterSqlParameter
public static SqlParameter<Byte> create(String name, byte value)
Byte
parameter with the given name and value.name
- the name of the parametervalue
- the value of the parameterSqlParameter
public static SqlParameter<byte[]> create(String name, byte[] value)
byte[]
parameter with the given name and value.name
- the name of the parametervalue
- the value of the parameterSqlParameter
public void fillStatement(int parameterNumber, PreparedStatement statement) throws SQLException
parameterNumber
- the parameter number for this parameter in the given PreparedStatement
statement
- the PreparedStatement
to fillSQLException
- thrown if there is an issue setting the parameter on the statementpublic String getName()
public T getValue()
Copyright © 2021. All rights reserved.