net.mlw.vlh.adapter.jdbc.util.setter
Class TimestampSetter

java.lang.Object
  extended bynet.mlw.vlh.adapter.jdbc.util.setter.AbstractSetter
      extended bynet.mlw.vlh.adapter.jdbc.util.setter.TimestampSetter
All Implemented Interfaces:
Setter
Direct Known Subclasses:
SasDateSetter

public class TimestampSetter
extends AbstractSetter

Sets a java.sql.Types.TIMESTAMP on a query using PreparedStatement.setTimestamp(). Conversion is provided for types java.sql.Timestamp, java.util.Date, java.util.Calendar. Conversion from a string is provided using a formater - the default format is "MM/dd/yyyy".

Version:
$Revision: 1.6 $ $Date: 2005/12/19 10:56:41 $
Author:
Matthew L. Wilson
See Also:
PreparedStatement.setTimestamp(int, java.sql.Timestamp)

Field Summary
static String DEFAULT_FORMAT
           
protected  SimpleDateFormat formatter
           
 
Constructor Summary
TimestampSetter()
           
 
Method Summary
 int set(PreparedStatement query, int index, Object value)
          Set the object on the given query.
 void setFormat(String format)
           
 
Methods inherited from class net.mlw.vlh.adapter.jdbc.util.setter.AbstractSetter
getReplacementString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FORMAT

public static final String DEFAULT_FORMAT
See Also:
Constant Field Values

formatter

protected SimpleDateFormat formatter
Constructor Detail

TimestampSetter

public TimestampSetter()
Method Detail

set

public int set(PreparedStatement query,
               int index,
               Object value)
        throws SQLException,
               ParseException
Description copied from interface: Setter
Set the object on the given query.

Parameters:
query - The PreparedStatement.
index - The name of the argument
value - The value to be set
Throws:
ParseException - If an error occurs.
SQLException - If an error occurs.
See Also:
Setter.set(java.sql.PreparedStatement, int, java.lang.Object)

setFormat

public void setFormat(String format)
Parameters:
format - The format to set.


Copyright © 2003-2006 mlavilson. All Rights Reserved.