|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sape.sqlutils.PreparedStatementHelper
A helper class to bind values to a PreparedStatement. If the value is null, setNull() with appropriate parameters is called. The following types of values are supported: boolean, Boolean int, Integer long, Long double, Double BigDecimal String Date (to java.sql.Date and java.sql.Timestamp)
Constructor Summary | |
PreparedStatementHelper()
|
Method Summary | |
static void |
bind(PreparedStatement ps,
int position,
BigDecimal value)
Binds a BigDecimal to a PreparedStatement. |
static void |
bind(PreparedStatement ps,
int position,
boolean value)
Binds a boolean to a PreparedStatement. |
static void |
bind(PreparedStatement ps,
int position,
Boolean value)
Binds a Boolean to a PreparedStatement. |
static void |
bind(PreparedStatement ps,
int position,
double value)
Binds a double to a PreparedStatement. |
static void |
bind(PreparedStatement ps,
int position,
Double value)
Binds a Double to a PreparedStatement. |
static void |
bind(PreparedStatement ps,
int position,
int value)
Binds a int to a PreparedStatement. |
static void |
bind(PreparedStatement ps,
int position,
Integer value)
Binds an Integer to a PreparedStatement. |
static void |
bind(PreparedStatement ps,
int position,
long value)
Binds a long to a PreparedStatement. |
static void |
bind(PreparedStatement ps,
int position,
Long value)
Binds a Long to a PreparedStatement. |
static void |
bind(PreparedStatement ps,
int position,
String value)
Binds a String to a PreparedStatement. |
static void |
bindDate(PreparedStatement ps,
int position,
Date value)
Converts a java.util.Date to a java.sql.Date and binds it to a PreparedStatement. |
static void |
bindDate(PreparedStatement ps,
int position,
Date value,
Calendar cal)
Converts a java.util.Date to a java.sql.Date and binds it to a PreparedStatement. |
static void |
bindTimestamp(PreparedStatement ps,
int position,
Date value)
Converts a java.util.Date to a java.sql.Timestamp and binds it to a PreparedStatement. |
static void |
bindTimestamp(PreparedStatement ps,
int position,
Date value,
Calendar cal)
Converts a java.util.Date to a java.sql.Timestamp and binds it to a PreparedStatement. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PreparedStatementHelper()
Method Detail |
public static void bind(PreparedStatement ps, int position, boolean value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
public static void bind(PreparedStatement ps, int position, Boolean value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
- if a error occurs while binding.public static void bind(PreparedStatement ps, int position, int value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
- if a error occurs while binding.public static void bind(PreparedStatement ps, int position, Integer value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
- if a error occurs while binding.public static void bind(PreparedStatement ps, int position, long value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
- if a error occurs while binding.public static void bind(PreparedStatement ps, int position, Long value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
- if a error occurs while binding.public static void bind(PreparedStatement ps, int position, double value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
- if a error occurs while binding.public static void bind(PreparedStatement ps, int position, Double value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
- if a error occurs while binding.public static void bind(PreparedStatement ps, int position, BigDecimal value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
- if a error occurs while binding.public static void bind(PreparedStatement ps, int position, String value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
- if a error occurs while binding.public static void bindDate(PreparedStatement ps, int position, Date value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
public static void bindDate(PreparedStatement ps, int position, Date value, Calendar cal) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be boundcal
- the calendar object used to determine the timezone
SQLException
public static void bindTimestamp(PreparedStatement ps, int position, Date value) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be bound
SQLException
public static void bindTimestamp(PreparedStatement ps, int position, Date value, Calendar cal) throws SQLException
ps
- the PreparedStatement to be boundposition
- the location to which the value is to be boundvalue
- the value to be boundcal
- the calendar object used to determine the timezone
SQLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |