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 TypeMethodDescriptionvoidclose()Close this statement.voidexecute()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.intintvoidsetBigDecimal(int p_iIdx, Object p_value) voidsetBoolean(int p_iIdx, Object p_value) voidvoidsetCharacterStream(int p_iIdx, Object p_value) voidvoidvoidvoidvoidsetFetchSize(int p_iFetchSize) voidvoidvoidvoidvoidvoidvoidvoidvoidsetTimestamp(int p_iIdx, Object p_value) voidsetTimestamp(int p_iIdx, Object p_value, Calendar p_cal) voidsetTimestamp(int p_iIdx, Object p_value, TimeZone p_tz)
-
Method Details
-
getFetchSize
- Specified by:
getFetchSizein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSizein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin 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,
nullis returned.- Specified by:
executeAndGetScalarValueHolderin 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
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.- Specified by:
executeAndGetScalarValuein 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_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.- Specified by:
executeAndGetScalarValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- 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
public Boolean executeAndGetScalarBooleanValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarBooleanValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarBooleanValue
public Boolean executeAndGetScalarBooleanValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarBooleanValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarByteValue
public Byte executeAndGetScalarByteValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarByteValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarByteValue
public Byte executeAndGetScalarByteValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarByteValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarShortValue
public Short executeAndGetScalarShortValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarShortValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarShortValue
public Short executeAndGetScalarShortValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarShortValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarIntValue
public Integer executeAndGetScalarIntValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarIntValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarIntValue
public Integer executeAndGetScalarIntValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarIntValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarLongValue
public Long executeAndGetScalarLongValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarLongValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarLongValue
public Long executeAndGetScalarLongValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarLongValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarFloatValue
public Float executeAndGetScalarFloatValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarFloatValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarFloatValue
public Float executeAndGetScalarFloatValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarFloatValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarDoubleValue
public Double executeAndGetScalarDoubleValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarDoubleValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarDoubleValue
public Double executeAndGetScalarDoubleValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarDoubleValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarBigDecimalValue
public BigDecimal executeAndGetScalarBigDecimalValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarBigDecimalValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarBigDecimalValue
public BigDecimal executeAndGetScalarBigDecimalValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarBigDecimalValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarStringValue
public String executeAndGetScalarStringValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarStringValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarStringValue
public String executeAndGetScalarStringValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarStringValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarTimestampValue
public Timestamp executeAndGetScalarTimestampValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarTimestampValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarTimestampValue
public Timestamp executeAndGetScalarTimestampValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarTimestampValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarDateValue
public Date executeAndGetScalarDateValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarDateValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarDateValue
public Date executeAndGetScalarDateValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarDateValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarTimeValue
public Date executeAndGetScalarTimeValue(Object p_valueFallback) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException - Specified by:
executeAndGetScalarTimeValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
executeAndGetScalarTimeValue
public Date executeAndGetScalarTimeValue() throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException- Specified by:
executeAndGetScalarTimeValuein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionde.uplanet.lucy.server.util.db.ValueCastException
-
setBoolean
- Specified by:
setBooleanin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setInt
- Specified by:
setIntin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setLong
- Specified by:
setLongin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setShort
- Specified by:
setShortin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setByte
- Specified by:
setBytein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setBigDecimal
- Specified by:
setBigDecimalin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setFloat
- Specified by:
setFloatin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setDouble
- Specified by:
setDoublein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setTimestamp
- Specified by:
setTimestampin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setTime
- Specified by:
setTimein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setDate
- Specified by:
setDatein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setString
- Specified by:
setStringin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException
-
setCharacterStream
- Specified by:
setCharacterStreamin interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLExceptionIOException
-
close
Close this statement.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacede.uplanet.lucy.server.util.db.IDbPreparedStatement- Throws:
SQLException- If a database error occurred.
-