Package de.uplanet.lucy.server.util.db
Class DbResultSet
- java.lang.Object
-
- de.uplanet.lucy.server.util.db.DbResultSet
-
- All Implemented Interfaces:
de.uplanet.lucy.server.util.db.IDbResultSet
,de.uplanet.lucy.server.util.db.IValueAccess
,de.uplanet.lucy.server.util.db.IValueHolderAccess
,de.uplanet.util.ICloseable
,AutoCloseable
,Iterable<IDbRow>
public final class DbResultSet extends Object implements de.uplanet.lucy.server.util.db.IDbResultSet, Iterable<IDbRow>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
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.BigDecimal
getBigDecimalValue(int p_iIdx)
BigDecimal
getBigDecimalValue(int p_iIdx, BigDecimal p_valueIfNull)
Boolean
getBooleanValue(int p_iIdx)
Boolean
getBooleanValue(int p_iIdx, Boolean p_valueIfNull)
byte
getByteValue(int p_iIdx)
Byte
getByteValue(int p_iIdx, Byte p_valueIfNull)
Date
getDateValue(int p_iIdx)
Date
getDateValue(int p_iIdx, Calendar p_cal)
Date
getDateValue(int p_iIdx, Date p_valueIfNull)
Date
getDateValue(int p_iIdx, Date p_valueIfNull, Calendar p_cal)
Date
getDateValue(int p_iIdx, Date p_valueIfNull, TimeZone p_tz)
Date
getDateValue(int p_iIdx, TimeZone p_tz)
de.uplanet.lucy.server.util.db.DbRowList
getDisconnectedRowList()
Create a list of disconnected rows from this result set.Double
getDoubleValue(int p_iIdx)
Double
getDoubleValue(int p_iIdx, Double p_valueIfNull)
Float
getFloatValue(int p_iIdx)
Float
getFloatValue(int p_iIdx, Float p_valueIfNull)
Integer
getIntValue(int p_iIdx)
Integer
getIntValue(int p_iIdx, Integer p_valueIfNull)
Long
getLongValue(int p_iIdx)
Long
getLongValue(int p_iIdx, Long p_valueIfNull)
int
getRowCount()
Get the number of rows read so far.Short
getShortValue(int p_iIdx)
Short
getShortValue(int p_iIdx, Short p_valueIfNull)
String
getStringValue(int p_iIdx)
String
getStringValue(int p_iIdx, String p_valueIfNull)
Timestamp
getTimestampValue(int p_iIdx)
Timestamp
getTimestampValue(int p_iIdx, Timestamp p_valueIfNull)
Timestamp
getTimestampValue(int p_iIdx, Timestamp p_valueIfNull, Calendar p_cal)
Timestamp
getTimestampValue(int p_iIdx, Timestamp p_valueIfNull, TimeZone p_tz)
Timestamp
getTimestampValue(int p_iIdx, Calendar p_cal)
Timestamp
getTimestampValue(int p_iIdx, TimeZone p_tz)
Date
getTimeValue(int p_iIdx)
Date
getTimeValue(int p_iIdx, Calendar p_cal)
Date
getTimeValue(int p_iIdx, Date p_valueIfNull)
Date
getTimeValue(int p_iIdx, Date p_valueIfNull, Calendar p_cal)
Date
getTimeValue(int p_iIdx, Date p_valueIfNull, TimeZone p_tz)
Date
getTimeValue(int p_iIdx, TimeZone p_tz)
Object
getValue(int p_iIdx)
Object
getValue(int p_iIdx, Object p_valueIfNull)
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<?>
grep(Object p_filter)
This method is not supportedIterator<IDbRow>
iterator()
boolean
next()
boolean
wasNull(int p_iIdx)
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getRowCount
public int getRowCount()
Get the number of rows read so far.- Returns:
- The number of rows read so far.
-
next
public boolean next() throws SQLException
- Specified by:
next
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
-
wasNull
public boolean wasNull(int p_iIdx) throws SQLException
- Specified by:
wasNull
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
-
getValueHolder
public IValueHolder<?> getValueHolder(int p_iIdx) throws SQLException
- Specified by:
getValueHolder
in interfacede.uplanet.lucy.server.util.db.IValueHolderAccess
- Throws:
SQLException
-
getValueHolder
public IValueHolder<?> getValueHolder(int p_iIdx, QName p_qmnDataType) throws SQLException
- Specified by:
getValueHolder
in interfacede.uplanet.lucy.server.util.db.IValueHolderAccess
- Throws:
SQLException
-
getValueHolder
public IValueHolder<?> getValueHolder(int p_iIdx, String p_strDataTypeAsSerializedQName) throws SQLException
- Specified by:
getValueHolder
in interfacede.uplanet.lucy.server.util.db.IValueHolderAccess
- Throws:
SQLException
-
getValueHolder
public IValueHolder<?> getValueHolder(int p_iIdx, QName p_qmnDataType, IValueHolder<?> p_valueIfNull) throws SQLException
- Specified by:
getValueHolder
in interfacede.uplanet.lucy.server.util.db.IValueHolderAccess
- Throws:
SQLException
-
getValueHolder
public IValueHolder<?> getValueHolder(int p_iIdx, String p_strDataTypeAsSerializedQName, IValueHolder<?> p_valueIfNull) throws SQLException
- Specified by:
getValueHolder
in interfacede.uplanet.lucy.server.util.db.IValueHolderAccess
- Throws:
SQLException
-
close
public void close() throws SQLException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
-
getValue
public Object getValue(int p_iIdx) throws SQLException
- Specified by:
getValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
-
getValue
public Object getValue(int p_iIdx, Object p_valueIfNull) throws SQLException
- Specified by:
getValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
-
getBooleanValue
public Boolean getBooleanValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getBooleanValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getBooleanValue
public Boolean getBooleanValue(int p_iIdx, Boolean p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getBooleanValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getByteValue
public byte getByteValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getByteValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getByteValue
public Byte getByteValue(int p_iIdx, Byte p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getByteValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getShortValue
public Short getShortValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getShortValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getShortValue
public Short getShortValue(int p_iIdx, Short p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getShortValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getIntValue
public Integer getIntValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getIntValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getIntValue
public Integer getIntValue(int p_iIdx, Integer p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getIntValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getLongValue
public Long getLongValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getLongValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getLongValue
public Long getLongValue(int p_iIdx, Long p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getLongValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getFloatValue
public Float getFloatValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getFloatValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getFloatValue
public Float getFloatValue(int p_iIdx, Float p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getFloatValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getDoubleValue
public Double getDoubleValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getDoubleValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getDoubleValue
public Double getDoubleValue(int p_iIdx, Double p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getDoubleValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getBigDecimalValue
public BigDecimal getBigDecimalValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getBigDecimalValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getBigDecimalValue
public BigDecimal getBigDecimalValue(int p_iIdx, BigDecimal p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getBigDecimalValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getStringValue
public String getStringValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getStringValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getStringValue
public String getStringValue(int p_iIdx, String p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getStringValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimestampValue
public Timestamp getTimestampValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimestampValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimestampValue
public Timestamp getTimestampValue(int p_iIdx, Calendar p_cal) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimestampValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimestampValue
public Timestamp getTimestampValue(int p_iIdx, TimeZone p_tz) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimestampValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimestampValue
public Timestamp getTimestampValue(int p_iIdx, Timestamp p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimestampValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimestampValue
public Timestamp getTimestampValue(int p_iIdx, Timestamp p_valueIfNull, TimeZone p_tz) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimestampValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimestampValue
public Timestamp getTimestampValue(int p_iIdx, Timestamp p_valueIfNull, Calendar p_cal) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimestampValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getDateValue
public Date getDateValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getDateValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getDateValue
public Date getDateValue(int p_iIdx, Calendar p_cal) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getDateValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getDateValue
public Date getDateValue(int p_iIdx, TimeZone p_tz) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getDateValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getDateValue
public Date getDateValue(int p_iIdx, Date p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getDateValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getDateValue
public Date getDateValue(int p_iIdx, Date p_valueIfNull, TimeZone p_tz) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getDateValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getDateValue
public Date getDateValue(int p_iIdx, Date p_valueIfNull, Calendar p_cal) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getDateValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimeValue
public Date getTimeValue(int p_iIdx) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimeValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimeValue
public Date getTimeValue(int p_iIdx, Calendar p_cal) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimeValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimeValue
public Date getTimeValue(int p_iIdx, TimeZone p_tz) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimeValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimeValue
public Date getTimeValue(int p_iIdx, Date p_valueIfNull) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimeValue
in interfacede.uplanet.lucy.server.util.db.IValueAccess
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimeValue
public Date getTimeValue(int p_iIdx, Date p_valueIfNull, TimeZone p_tz) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimeValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getTimeValue
public Date getTimeValue(int p_iIdx, Date p_valueIfNull, Calendar p_cal) throws SQLException, de.uplanet.lucy.server.util.db.ValueCastException
- Specified by:
getTimeValue
in interfacede.uplanet.lucy.server.util.db.IDbResultSet
- Throws:
SQLException
de.uplanet.lucy.server.util.db.ValueCastException
-
getDisconnectedRowList
public de.uplanet.lucy.server.util.db.DbRowList getDisconnectedRowList()
Create 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.
-
findAll
public 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.- 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.
-
grep
public Collection<?> grep(Object p_filter)
This method is not supported.
- Throws:
UnsupportedOperationException
-
-