jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.dbutil
Class DateColumnDescriptor

java.lang.Object
  extended byuk.co.weft.dbutil.ColumnDescriptor
      extended byuk.co.weft.dbutil.DateColumnDescriptor
Direct Known Subclasses:
TimeStampColumnDescriptor

public class DateColumnDescriptor
extends ColumnDescriptor

A descriptor for an date column.

NoteOn SQL Server 2000, the language definred for the logins controls the way in which dates are formatted for that user and if the dates don't format as we expect DateColumnDescriptor will fail to interpret them correctly.

If the language is set to 'English' (as opposed to either 'US English' or 'British English') the date collation works.

Version:
$Revision: 1.15.4.1 $ This revision: $Author: simon $
Author:
Simon Brooke

Constructor Summary
DateColumnDescriptor(java.lang.String n)
          Creates a new DateColumnDescriptor object.
 
Method Summary
protected  java.lang.String format(Context c)
          Format a date for sending to this column in the database.
protected  java.lang.Object interpret(Context context, java.sql.ResultSet results)
          put into this context an interpretation of the value of my name as a date in these results.
 
Methods inherited from class uk.co.weft.dbutil.ColumnDescriptor
createColumnDescriptor, formatForInsert, formatForMatch, formatForMatch, formatForSelect, formatForUpdate, genKey, quoteValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateColumnDescriptor

public DateColumnDescriptor(java.lang.String n)
Creates a new DateColumnDescriptor object.

Parameters:
n - name
Method Detail

format

protected java.lang.String format(Context c)
                           throws DataFormatException
Format a date for sending to this column in the database.

Overrides:
format in class ColumnDescriptor
Parameters:
c - a context in which a value may be found
Throws:
throws - DataFormatException if value is null and column is not nullable
DataFormatException

interpret

protected java.lang.Object interpret(Context context,
                                     java.sql.ResultSet results)
                              throws DataFormatException
put into this context an interpretation of the value of my name as a date in these results.

Overrides:
interpret in class ColumnDescriptor
Throws:
DataFormatException

jacquard 1.12.0 by The Web Engineering Factory and Toolworks