Package de.uplanet.lucy.server.util.db
Interface IDbPreparedStatement
- All Superinterfaces:
 AutoCloseable,ICloseable
- All Known Implementing Classes:
 DbPreparedStatement
- 
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this statement.voidexecute()Executes the SQL statement in this object, which may be any kind of SQL statement.Typed version ofexecuteAndGetScalarValue().executeAndGetScalarBigDecimalValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarBooleanValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarByteValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarDateValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarDoubleValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarFloatValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarIntValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarLongValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarShortValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarStringValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarTimestampValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).Typed version ofexecuteAndGetScalarValue().executeAndGetScalarTimeValue(Object p_valueFallback) Typed version ofexecuteAndGetScalarValue(Object).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.Executes the SQL query in this object and returns theIDbResultSetobject generated by the query.intExecutes the SQL statement in this object, which must be an SQL Data Manipulation Language (DML) statement, such asINSERT,UPDATEorDELETE; or an SQL statement that returns nothing, such as a DDL statement.intGet the fetch size of the underlying prepared statement.voidsetBigDecimal(int p_iIdx, Object p_value) Sets the designated parameter to the given number value.voidsetBoolean(int p_iIdx, Object p_value) Sets the designated parameter to the given boolean value.voidSets the designated parameter to the given integer value.voidsetCharacterStream(int p_iIdx, Object p_value) Sets the designated parameter to the value given string value.voidSets the designated parameter to the given date value.voidSets the designated parameter to the given date value.voidSets the designated parameter to the given date value.voidSets the designated parameter to the given floating point number value.voidsetFetchSize(int p_iFetchSize) Set the fetch size of the underlying prepared statement.voidSets the designated parameter to the given floating point number value.voidSets the designated parameter to the given integer number value.voidSets the designated parameter to the given integer number value.voidSets the designated parameter to the given integer number value.voidSets the designated parameter to the given string value.voidSets the designated parameter to the given time value.voidSets the designated parameter to the given time value.voidSets the designated parameter to the given time value.voidsetTimestamp(int p_iIdx, Object p_value) Sets the designated parameter to the given timestamp value.voidsetTimestamp(int p_iIdx, Object p_value, Calendar p_cal) Sets the designated parameter to the given timestamp value.voidsetTimestamp(int p_iIdx, Object p_value, TimeZone p_tz) Sets the designated parameter to the given timestamp value. 
- 
Method Details
- 
getFetchSize
Get the fetch size of the underlying prepared statement.- Returns:
 - The fetch size.
 - Throws:
 SQLException- See Also:
 
 - 
setFetchSize
Set the fetch size of the underlying prepared statement.- Parameters:
 p_iFetchSize- The fetch size.- Throws:
 SQLException- See Also:
 
 - 
execute
Executes the SQL statement in this object, which may be any kind of SQL statement.- Throws:
 SQLException- If a database error occurred.
 - 
executeUpdate
Executes the SQL statement in this object, which must be an SQL Data Manipulation Language (DML) statement, such asINSERT,UPDATEorDELETE; or an SQL statement that returns nothing, such as a DDL statement.- Throws:
 SQLException- If a database error occurred.
 - 
executeQuery
Executes the SQL query in this object and returns theIDbResultSetobject generated by the query.- Returns:
 - An 
IDbResultSetobject that contains the data produced by the query; nevernull. - Throws:
 SQLException- If a database error occurred.
 - 
executeAndGetScalarValueHolder
Get the value of the first column in the first row of the result set.If the result set is empty,
nullis returned.- Returns:
 - A value holder that contains the value of the first column in the first
    row of the result set, or 
nullif 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_valueIfNullis returned.- 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_valueIfNullif 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,
nullis returned.- Returns:
 - The value of the first column in the first row of the result set,
    or 
nullif the result set is empty. - Throws:
 SQLException
 - 
executeAndGetScalarBooleanValue
Boolean executeAndGetScalarBooleanValue(Object p_valueFallback) throws SQLException, ValueCastException Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarBooleanValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarByteValue
Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarByteValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarShortValue
Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarShortValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarIntValue
Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarIntValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarLongValue
Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarLongValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarFloatValue
Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarFloatValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarDoubleValue
Double executeAndGetScalarDoubleValue(Object p_valueFallback) throws SQLException, ValueCastException Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarDoubleValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarBigDecimalValue
BigDecimal executeAndGetScalarBigDecimalValue(Object p_valueFallback) throws SQLException, ValueCastException Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarBigDecimalValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarStringValue
String executeAndGetScalarStringValue(Object p_valueFallback) throws SQLException, ValueCastException Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarStringValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarTimestampValue
Timestamp executeAndGetScalarTimestampValue(Object p_valueFallback) throws SQLException, ValueCastException Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarTimestampValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarDateValue
Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarDateValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarTimeValue
Typed version ofexecuteAndGetScalarValue(Object).- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
executeAndGetScalarTimeValue
Typed version ofexecuteAndGetScalarValue().- Throws:
 SQLException- If a database error occurred.ValueCastException- If the database value could not be cast to the specific type.- See Also:
 
 - 
setBoolean
Sets the designated parameter to the given boolean value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setInt
Sets the designated parameter to the given integer number value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setLong
Sets the designated parameter to the given integer number value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setShort
Sets the designated parameter to the given integer number value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setByte
Sets the designated parameter to the given integer value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setBigDecimal
Sets the designated parameter to the given number value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setFloat
Sets the designated parameter to the given floating point number value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setDouble
Sets the designated parameter to the given floating point number value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setTimestamp
Sets the designated parameter to the given timestamp value.A calendar with the time zone that is associated with the database connection that was used to create this statement is used to write the timestamp to the database.
- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setTimestamp
Sets the designated parameter to the given timestamp value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.p_tz- The time zone to be used when writing the timestamp to the database. If this parameter is omitted, the time zone that is associated with the database connection that was used to create this statement is used.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setTimestamp
Sets the designated parameter to the given timestamp value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.p_cal- The calendar to be used when writing the timestamp to the database. If this parameter is omitted, a calendar with the time zone that is associated with the database connection that was used to create this statement is used.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setTime
Sets the designated parameter to the given time value.A calendar with the time zone that is associated with the database connection that was used to create this statement is used to write the time value to the database.
- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setTime
Sets the designated parameter to the given time value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.p_tz- The time zone to be used when writing the time value to the database. If this parameter is omitted, the time zone that is associated with the database connection that was used to create this statement is used.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setTime
Sets the designated parameter to the given time value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.p_cal- The calendar to be used when writing the time to the database. If this parameter is omitted, a calendar with the time zone that is associated with the database connection that was used to create this statement is used.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setDate
Sets the designated parameter to the given date value.A calendar with the time zone that is associated with the database connection that was used to create this statement is used to write the time value to the database.
- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setDate
Sets the designated parameter to the given date value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.p_tz- The time zone to be used when writing the date value to the database. If this parameter is omitted, the time zone that is associated with the database connection that was used to create this statement is used.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setDate
Sets the designated parameter to the given date value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.p_cal- The calendar to be used when writing the date to the database. If this parameter is omitted, a calendar with the time zone that is associated with the database connection that was used to create this statement is used.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setString
Sets the designated parameter to the given string value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.
 - 
setCharacterStream
Sets the designated parameter to the value given string value.- Parameters:
 p_iIdx- The first parameter is 1, the second is 2, ...p_value- The parameter value.- Throws:
 SQLException- If the parameter index does not correspond to a parameter marker in the SQL statement, if a database access error occurs, or this method is called on a closed statement.IOException
 - 
close
Close this statement.- Specified by:
 closein interfaceAutoCloseable- Throws:
 SQLException- If a database error occurred.
 
 -