Package de.uplanet.lucy.server.util.db
Class DbResultSet
java.lang.Object
de.uplanet.lucy.server.util.db.DbResultSet
- All Implemented Interfaces:
- IDbResultSet,- IValueAccess,- IValueHolderAccess,- de.uplanet.util.ICloseable,- AutoCloseable,- Iterable<IDbRow>
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()List<?>findAll(groovy.lang.Closure<?> p_closure) Calls the given closure for every row in the result set and returns a list of rows for which the closure is valid.getBigDecimalValue(int p_iIdx) Get a decimal number value.getBigDecimalValue(int p_iIdx, BigDecimal p_valueIfNull) Get a decimal number value.getBooleanValue(int p_iIdx) Get a boolean value.getBooleanValue(int p_iIdx, Boolean p_valueIfNull) Get a boolean value.bytegetByteValue(int p_iIdx) Get a byte value.getByteValue(int p_iIdx, Byte p_valueIfNull) Get a byte value.getDateValue(int p_iIdx) Get a date value.getDateValue(int p_iIdx, Calendar p_cal) getDateValue(int p_iIdx, Date p_valueIfNull) Get a date value.getDateValue(int p_iIdx, Date p_valueIfNull, Calendar p_cal) getDateValue(int p_iIdx, Date p_valueIfNull, TimeZone p_tz) getDateValue(int p_iIdx, TimeZone p_tz) Create a list of disconnected rows from this result set.getDoubleValue(int p_iIdx) Get a double value.getDoubleValue(int p_iIdx, Double p_valueIfNull) Get a double precision float value.getFloatValue(int p_iIdx) Get a single precision float value.getFloatValue(int p_iIdx, Float p_valueIfNull) Get a single precision float value.getIntValue(int p_iIdx) Get an integer value.getIntValue(int p_iIdx, Integer p_valueIfNull) Get an integer value.getLongValue(int p_iIdx) Get a long value.getLongValue(int p_iIdx, Long p_valueIfNull) Get a long value.intGet the number of rows read so far.getShortValue(int p_iIdx) Get a short value.getShortValue(int p_iIdx, Short p_valueIfNull) Get a short value.getStringValue(int p_iIdx) Get a string value.getStringValue(int p_iIdx, String p_valueIfNull) Get a string value.getTimestampValue(int p_iIdx) Get a timestamp value.getTimestampValue(int p_iIdx, Timestamp p_valueIfNull) Get a timestamp value.getTimestampValue(int p_iIdx, Timestamp p_valueIfNull, Calendar p_cal) getTimestampValue(int p_iIdx, Timestamp p_valueIfNull, TimeZone p_tz) getTimestampValue(int p_iIdx, Calendar p_cal) getTimestampValue(int p_iIdx, TimeZone p_tz) getTimeValue(int p_iIdx) Get a time value.getTimeValue(int p_iIdx, Calendar p_cal) getTimeValue(int p_iIdx, Date p_valueIfNull) Get a time value.getTimeValue(int p_iIdx, Date p_valueIfNull, Calendar p_cal) getTimeValue(int p_iIdx, Date p_valueIfNull, TimeZone p_tz) getTimeValue(int p_iIdx, TimeZone p_tz) getValue(int p_iIdx) Get a value.Get a value.IValueHolder<?>getValueHolder(int p_iIdx) IValueHolder<?>getValueHolder(int p_iIdx, String p_strDataTypeAsSerializedQName) IValueHolder<?>getValueHolder(int p_iIdx, String p_strDataTypeAsSerializedQName, IValueHolder<?> p_valueIfNull) IValueHolder<?>getValueHolder(int p_iIdx, QName p_qmnDataType) IValueHolder<?>getValueHolder(int p_iIdx, QName p_qmnDataType, IValueHolder<?> p_valueIfNull) Collection<?>This method is not supportediterator()booleannext()booleanwasNull(int p_iIdx) Check if the value in the given column wasnull.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Method Details- 
getRowCountpublic int getRowCount()Get the number of rows read so far.- Returns:
- The number of rows read so far.
 
- 
next- Specified by:
- nextin interface- IDbResultSet
- Throws:
- SQLException
 
- 
wasNullDescription copied from interface:IValueAccessCheck if the value in the given column wasnull.- Specified by:
- wasNullin interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- trueif the value was- null, or- falseotherwise.
- Throws:
- SQLException- If a database error occurred.
 
- 
getValueHolder- Specified by:
- getValueHolderin interface- IValueHolderAccess
- Throws:
- SQLException
 
- 
getValueHolder- Specified by:
- getValueHolderin interface- IValueHolderAccess
- Throws:
- SQLException
 
- 
getValueHolderpublic IValueHolder<?> getValueHolder(int p_iIdx, String p_strDataTypeAsSerializedQName) throws SQLException - Specified by:
- getValueHolderin interface- IValueHolderAccess
- Throws:
- SQLException
 
- 
getValueHolderpublic IValueHolder<?> getValueHolder(int p_iIdx, QName p_qmnDataType, IValueHolder<?> p_valueIfNull) throws SQLException - Specified by:
- getValueHolderin interface- IValueHolderAccess
- Throws:
- SQLException
 
- 
getValueHolderpublic IValueHolder<?> getValueHolder(int p_iIdx, String p_strDataTypeAsSerializedQName, IValueHolder<?> p_valueIfNull) throws SQLException - Specified by:
- getValueHolderin interface- IValueHolderAccess
- Throws:
- SQLException
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- IDbResultSet
- Throws:
- SQLException
 
- 
getValueDescription copied from interface:IValueAccessGet a value. Note: The use of this method is discouraged. Use a method that returns a specified type instead.- Specified by:
- getValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- The value.
- Throws:
- SQLException- If a database error occurred.
 
- 
getValueDescription copied from interface:IValueAccessGet a value. Note: The use of this method is discouraged. Use a method that returns a specified type instead.- Specified by:
- getValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- The value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
 
- 
getBooleanValueDescription copied from interface:IValueAccessGet a boolean value.- Specified by:
- getBooleanValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A boolean value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to boolean.
 
- 
getBooleanValuepublic Boolean getBooleanValue(int p_iIdx, Boolean p_valueIfNull) throws SQLException, ValueCastException Description copied from interface:IValueAccessGet a boolean value.- Specified by:
- getBooleanValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A boolean value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to boolean.
 
- 
getByteValueDescription copied from interface:IValueAccessGet a byte value.- Specified by:
- getByteValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A byte value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to byte.
 
- 
getByteValueDescription copied from interface:IValueAccessGet a byte value.- Specified by:
- getByteValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A byte value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to byte.
 
- 
getShortValueDescription copied from interface:IValueAccessGet a short value.- Specified by:
- getShortValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A short value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to short.
 
- 
getShortValueDescription copied from interface:IValueAccessGet a short value.- Specified by:
- getShortValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A short value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to short.
 
- 
getIntValueDescription copied from interface:IValueAccessGet an integer value.- Specified by:
- getIntValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- An integer value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to integer.
 
- 
getIntValuepublic Integer getIntValue(int p_iIdx, Integer p_valueIfNull) throws SQLException, ValueCastException Description copied from interface:IValueAccessGet an integer value.- Specified by:
- getIntValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- An integer value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to integer.
 
- 
getLongValueDescription copied from interface:IValueAccessGet a long value.- Specified by:
- getLongValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A long value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to long.
 
- 
getLongValueDescription copied from interface:IValueAccessGet a long value.- Specified by:
- getLongValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A long value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to long.
 
- 
getFloatValueDescription copied from interface:IValueAccessGet a single precision float value.- Specified by:
- getFloatValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A float value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to float.
 
- 
getFloatValueDescription copied from interface:IValueAccessGet a single precision float value.- Specified by:
- getFloatValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A float value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to float.
 
- 
getDoubleValueDescription copied from interface:IValueAccessGet a double value.- Specified by:
- getDoubleValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A double value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to double.
 
- 
getDoubleValuepublic Double getDoubleValue(int p_iIdx, Double p_valueIfNull) throws SQLException, ValueCastException Description copied from interface:IValueAccessGet a double precision float value.- Specified by:
- getDoubleValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A double value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to double.
 
- 
getBigDecimalValueDescription copied from interface:IValueAccessGet a decimal number value.- Specified by:
- getBigDecimalValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A BigDecimal value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to BigDecimal.
 
- 
getBigDecimalValuepublic BigDecimal getBigDecimalValue(int p_iIdx, BigDecimal p_valueIfNull) throws SQLException, ValueCastException Description copied from interface:IValueAccessGet a decimal number value.- Specified by:
- getBigDecimalValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A BigDecimal value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to BigDecimal.
 
- 
getStringValueDescription copied from interface:IValueAccessGet a string value.- Specified by:
- getStringValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A string value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to a string.
 
- 
getStringValuepublic String getStringValue(int p_iIdx, String p_valueIfNull) throws SQLException, ValueCastException Description copied from interface:IValueAccessGet a string value.- Specified by:
- getStringValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A string value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to string.
 
- 
getTimestampValueDescription copied from interface:IValueAccessGet a timestamp value.- Specified by:
- getTimestampValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A timestamp value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to a timestamp.
 
- 
getTimestampValuepublic Timestamp getTimestampValue(int p_iIdx, Calendar p_cal) throws SQLException, ValueCastException - Specified by:
- getTimestampValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getTimestampValuepublic Timestamp getTimestampValue(int p_iIdx, TimeZone p_tz) throws SQLException, ValueCastException - Specified by:
- getTimestampValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getTimestampValuepublic Timestamp getTimestampValue(int p_iIdx, Timestamp p_valueIfNull) throws SQLException, ValueCastException Description copied from interface:IValueAccessGet a timestamp value.- Specified by:
- getTimestampValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A timestamp value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to timestamp.
 
- 
getTimestampValuepublic Timestamp getTimestampValue(int p_iIdx, Timestamp p_valueIfNull, TimeZone p_tz) throws SQLException, ValueCastException - Specified by:
- getTimestampValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getTimestampValuepublic Timestamp getTimestampValue(int p_iIdx, Timestamp p_valueIfNull, Calendar p_cal) throws SQLException, ValueCastException - Specified by:
- getTimestampValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getDateValueDescription copied from interface:IValueAccessGet a date value.- Specified by:
- getDateValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A date value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to date.
 
- 
getDateValue- Specified by:
- getDateValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getDateValue- Specified by:
- getDateValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getDateValueDescription copied from interface:IValueAccessGet a date value.- Specified by:
- getDateValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A date value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to date.
 
- 
getDateValuepublic Date getDateValue(int p_iIdx, Date p_valueIfNull, TimeZone p_tz) throws SQLException, ValueCastException - Specified by:
- getDateValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getDateValuepublic Date getDateValue(int p_iIdx, Date p_valueIfNull, Calendar p_cal) throws SQLException, ValueCastException - Specified by:
- getDateValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getTimeValueDescription copied from interface:IValueAccessGet a time value.- Specified by:
- getTimeValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- Returns:
- A time value, or null.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to time.
 
- 
getTimeValue- Specified by:
- getTimeValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getTimeValue- Specified by:
- getTimeValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getTimeValueDescription copied from interface:IValueAccessGet a time value.- Specified by:
- getTimeValuein interface- IValueAccess
- Parameters:
- p_iIdx- The 1-based column index.
- p_valueIfNull- The value to be returned if the database value was- NULL.
- Returns:
- A time value, or p_valueIfNull.
- Throws:
- SQLException- If a database error occurred.
- ValueCastException- If the database value could not be cast to time.
 
- 
getTimeValuepublic Date getTimeValue(int p_iIdx, Date p_valueIfNull, TimeZone p_tz) throws SQLException, ValueCastException - Specified by:
- getTimeValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getTimeValuepublic Date getTimeValue(int p_iIdx, Date p_valueIfNull, Calendar p_cal) throws SQLException, ValueCastException - Specified by:
- getTimeValuein interface- IDbResultSet
- Throws:
- SQLException
- ValueCastException
 
- 
getDisconnectedRowListCreate a list of disconnected rows from this result set.Note: - The result set data are at once fetched into memory so that calling this method may result in excessive memory consumption.
- After this method has been called, subsequent iterations over this result set will give no result. However anew call to this method will return the previous returned rows.
- Rows that were consumed in previous iterations over this result set will not be present in this list.
 - Returns:
- A list of disconnected rows.
 
- 
iterator
- 
findAllCalls the given closure for every row in the result set and returns a list of rows for which the closure is valid.- Parameters:
- p_closure- The closure that's being called.
- Returns:
- A list of rows the closure is valid for.
- Throws:
- UnsupportedOperationException- - If the result set does not provide disconnected rows.
 
- 
grepThis method is not supported. - Throws:
- UnsupportedOperationException
 
 
-