Package de.uplanet.lucy.server.util.db
Class DbPreparedStatement
java.lang.Object
de.uplanet.lucy.server.util.db.DbPreparedStatement
- All Implemented Interfaces:
de.uplanet.lucy.server.util.db.IDbPreparedStatement
,de.uplanet.util.ICloseable
,AutoCloseable
public final class DbPreparedStatement
extends Object
implements de.uplanet.lucy.server.util.db.IDbPreparedStatement
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this statement.void
execute()
executeAndGetScalarBigDecimalValue
(Object p_valueFallback) executeAndGetScalarBooleanValue
(Object p_valueFallback) executeAndGetScalarByteValue
(Object p_valueFallback) executeAndGetScalarDateValue
(Object p_valueFallback) executeAndGetScalarDoubleValue
(Object p_valueFallback) executeAndGetScalarFloatValue
(Object p_valueFallback) executeAndGetScalarIntValue
(Object p_valueFallback) executeAndGetScalarLongValue
(Object p_valueFallback) executeAndGetScalarShortValue
(Object p_valueFallback) executeAndGetScalarStringValue
(Object p_valueFallback) executeAndGetScalarTimestampValue
(Object p_valueFallback) executeAndGetScalarTimeValue
(Object p_valueFallback) Get the value of the first column in the first row of the result set.executeAndGetScalarValue
(Object p_valueFallback) Get the value of the first column in the first row of the result set.IValueHolder
<?> Get the value of the first column in the first row of the result set.int
int
void
setBigDecimal
(int p_iIdx, Object p_value) void
setBoolean
(int p_iIdx, Object p_value) void
void
setCharacterStream
(int p_iIdx, Object p_value) void
void
void
void
void
setFetchSize
(int p_iFetchSize) void
void
void
void
void
void
void
void
void
setTimestamp
(int p_iIdx, Object p_value) void
setTimestamp
(int p_iIdx, Object p_value, Calendar p_cal) void
setTimestamp
(int p_iIdx, Object p_value, TimeZone p_tz)
-
Method Details
-
getFetchSize
- Specified by:
getFetchSize
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSize
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
executeQuery
- Specified by:
executeQuery
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
executeAndGetScalarValueHolder
Get the value of the first column in the first row of the result set.If the result set is empty,
null
is returned.- Specified by:
executeAndGetScalarValueHolder
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Returns:
- A value holder that contains the value of the first column in the first
row of the result set, or
null
if the result set is empty. - Throws:
SQLException
-
executeAndGetScalarValue
Get the value of the first column in the first row of the result set.If the result set is empty, or the value is
null
,p_valueIfNull
is returned.- Specified by:
executeAndGetScalarValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Parameters:
p_valueFallback
- The return value if the query returns an empty result set ornull
.- Returns:
- The value of the first column in the first row of the result set,
or
p_valueIfNull
if the result set is empty, or the value isnull
. - Throws:
SQLException
-
executeAndGetScalarValue
Get the value of the first column in the first row of the result set.If the result set is empty,
null
is returned.- Specified by:
executeAndGetScalarValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Returns:
- The value of the first column in the first row of the result set,
or
null
if the result set is empty. - Throws:
SQLException
-
executeAndGetScalarBooleanValue
public Boolean executeAndGetScalarBooleanValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarBooleanValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarBooleanValue
public Boolean executeAndGetScalarBooleanValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarBooleanValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarByteValue
public Byte executeAndGetScalarByteValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarByteValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarByteValue
public Byte executeAndGetScalarByteValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarByteValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarShortValue
public Short executeAndGetScalarShortValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarShortValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarShortValue
public Short executeAndGetScalarShortValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarShortValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarIntValue
public Integer executeAndGetScalarIntValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarIntValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarIntValue
public Integer executeAndGetScalarIntValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarIntValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarLongValue
public Long executeAndGetScalarLongValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarLongValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarLongValue
public Long executeAndGetScalarLongValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarLongValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarFloatValue
public Float executeAndGetScalarFloatValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarFloatValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarFloatValue
public Float executeAndGetScalarFloatValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarFloatValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarDoubleValue
public Double executeAndGetScalarDoubleValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarDoubleValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarDoubleValue
public Double executeAndGetScalarDoubleValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarDoubleValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarBigDecimalValue
public BigDecimal executeAndGetScalarBigDecimalValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarBigDecimalValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarBigDecimalValue
public BigDecimal executeAndGetScalarBigDecimalValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarBigDecimalValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarStringValue
public String executeAndGetScalarStringValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarStringValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarStringValue
public String executeAndGetScalarStringValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarStringValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarTimestampValue
public Timestamp executeAndGetScalarTimestampValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarTimestampValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarTimestampValue
public Timestamp executeAndGetScalarTimestampValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarTimestampValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarDateValue
public Date executeAndGetScalarDateValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarDateValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarDateValue
public Date executeAndGetScalarDateValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarDateValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarTimeValue
public Date executeAndGetScalarTimeValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarTimeValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarTimeValue
public Date executeAndGetScalarTimeValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarTimeValue
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
setBoolean
- Specified by:
setBoolean
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setInt
- Specified by:
setInt
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setLong
- Specified by:
setLong
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setShort
- Specified by:
setShort
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setByte
- Specified by:
setByte
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setBigDecimal
- Specified by:
setBigDecimal
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setFloat
- Specified by:
setFloat
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setDouble
- Specified by:
setDouble
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestamp
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestamp
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestamp
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setTime
- Specified by:
setTime
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setTime
- Specified by:
setTime
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setTime
- Specified by:
setTime
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setDate
- Specified by:
setDate
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setDate
- Specified by:
setDate
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setDate
- Specified by:
setDate
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setString
- Specified by:
setString
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStream
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
IOException
-
close
Close this statement.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement
- Throws:
SQLException
- If a database error occurred.
-