jxUtil 0.6

org.sourceforge.jxutil.sql.type
Class AbstractDATE

java.lang.Object
  |
  +--org.sourceforge.jxutil.sql.type.AbstractType
        |
        +--org.sourceforge.jxutil.sql.type.AbstractDATE
Direct Known Subclasses:
DefaultDATE

public abstract class AbstractDATE
extends AbstractType

A type defining the generics of the DATE type.


Field Summary
 
Fields inherited from class org.sourceforge.jxutil.sql.type.AbstractType
BD_ONE, BD_ZERO, name
 
Constructor Summary
protected AbstractDATE(String name)
           
 
Method Summary
abstract  Date getDate(Object row, Calendar cal, ConversionContext ctx)
          Get the DATE value.
 Class getJavaClass()
          Get the Java Class returned when calling getObject on this type.
 Class getJavaType()
          Get the Java Class of the primitive type best representing data of this database type.
 int getJDBCType()
          Get the type's closest representation as a JDBC type.
 String getLiteralPrefix()
          Get the prefix to use for literal data of this type.
 String getLiteralSuffix()
          Get the suffix to use for literal data of this type.
 Object getObject(Object row, Map map, ConversionContext ctx)
          Get the DATE value as an Object.
 String getString(Object row, ConversionContext ctx)
          Get the DATE value as a String.
 Timestamp getTimestamp(Object row, Calendar cal, ConversionContext ctx)
          Get the DATE value as a Timestamp.
abstract  void setDate(Object row, Date val, Calendar cal, ConversionContext ctx)
          Set the DATE value.
 void setString(Object row, String val, ConversionContext ctx)
          Set the DATE value from a String.
 void setTimestamp(Object row, Timestamp val, Calendar cal, ConversionContext ctx)
          Set the DATE value from a Timestamp.
 
Methods inherited from class org.sourceforge.jxutil.sql.type.AbstractType
dataTruncationRead, dataTruncationWrite, deriveType, getArray, getAsciiStream, getAutoInc, getBigDecimal, getBinaryStream, getBlob, getBoolean, getByte, getBytes, getCaseSensitive, getCharacterStream, getClob, getCreateParams, getCurrency, getDate, getDouble, getFloat, getInt, getLiteral, getLocalName, getLong, getMaxScale, getMinScale, getName, getNullable, getNumRadix, getObject, getPrecision, getRef, getScale, getSearchable, getShort, getTime, getTime, getTimestamp, getUnsigned, getURL, noConversion, noConversion, noConversion, setArray, setAsciiStream, setBigDecimal, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setClob, setDate, setDouble, setFloat, setInt, setLong, setNull, setNull, setNull, setObject, setObject, setObject, setRef, setShort, setStruct, setTime, setTime, setTimestamp, setURL, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractDATE

protected AbstractDATE(String name)
Method Detail

getDate

public abstract Date getDate(Object row,
                             Calendar cal,
                             ConversionContext ctx)
                      throws SQLException
Get the DATE value.

Overrides:
getDate in class AbstractType
SQLException

getJavaClass

public final Class getJavaClass()
Description copied from class: AbstractType
Get the Java Class returned when calling getObject on this type.

Overrides:
getJavaClass in class AbstractType

getJavaType

public final Class getJavaType()
Description copied from class: AbstractType
Get the Java Class of the primitive type best representing data of this database type.

Overrides:
getJavaType in class AbstractType

getJDBCType

public final int getJDBCType()
Description copied from class: AbstractType
Get the type's closest representation as a JDBC type.

Specified by:
getJDBCType in class AbstractType
See Also:
Types

getLiteralPrefix

public String getLiteralPrefix()
Description copied from class: AbstractType
Get the prefix to use for literal data of this type.

Overrides:
getLiteralPrefix in class AbstractType

getLiteralSuffix

public String getLiteralSuffix()
Description copied from class: AbstractType
Get the suffix to use for literal data of this type.

Overrides:
getLiteralSuffix in class AbstractType

getObject

public final Object getObject(Object row,
                              Map map,
                              ConversionContext ctx)
                       throws SQLException
Get the DATE value as an Object.

Overrides:
getObject in class AbstractType
Returns:
the date instance
SQLException
See Also:
AbstractType.getDate(Object, ConversionContext)

getString

public final String getString(Object row,
                              ConversionContext ctx)
                       throws SQLException
Get the DATE value as a String.

Overrides:
getString in class AbstractType
SQLException

getTimestamp

public final Timestamp getTimestamp(Object row,
                                    Calendar cal,
                                    ConversionContext ctx)
                             throws SQLException
Get the DATE value as a Timestamp.

Overrides:
getTimestamp in class AbstractType
Returns:
the timestamp instance with the given date and zero time.
SQLException

setDate

public abstract void setDate(Object row,
                             Date val,
                             Calendar cal,
                             ConversionContext ctx)
                      throws SQLException
Set the DATE value.

Overrides:
setDate in class AbstractType
SQLException

setString

public final void setString(Object row,
                            String val,
                            ConversionContext ctx)
                     throws SQLException
Set the DATE value from a String. The string is trimmed and interpreted either as a Timestamp or a Date value.

Overrides:
setString in class AbstractType
SQLException

setTimestamp

public final void setTimestamp(Object row,
                               Timestamp val,
                               Calendar cal,
                               ConversionContext ctx)
                        throws SQLException
Set the DATE value from a Timestamp.

Overrides:
setTimestamp in class AbstractType
SQLException

jxUtil 0.6

Copyright © 2001,2002 Keve Müller, et al.; see LICENSE file for details.