org.apache.ddlutils.io.converters
Class TimestampConverter

java.lang.Object
  extended by org.apache.ddlutils.io.converters.TimestampConverter
All Implemented Interfaces:
SqlTypeConverter

public class TimestampConverter
extends Object
implements SqlTypeConverter

Converts between Timestamp and String using the standard representation "yyyy-mm-dd hh:mm:ss.fffffffff".

Version:
$Revision: 289996 $

Constructor Summary
TimestampConverter()
           
 
Method Summary
 Object convertFromString(String textRep, int sqlTypeCode)
          Converts the given textual representation to an instance of the target type.
 String convertToString(Object obj, int sqlTypeCode)
          Converts the given object to a string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimestampConverter

public TimestampConverter()
Method Detail

convertFromString

public Object convertFromString(String textRep,
                                int sqlTypeCode)
                         throws ConversionException
Converts the given textual representation to an instance of the target type.

Specified by:
convertFromString in interface SqlTypeConverter
Parameters:
textRep - The textual representation
sqlTypeCode - The target sql type code, one of the constants in Types
Returns:
The corresponding object
Throws:
ConversionException

convertToString

public String convertToString(Object obj,
                              int sqlTypeCode)
                       throws ConversionException
Converts the given object to a string representation.

Specified by:
convertToString in interface SqlTypeConverter
Parameters:
obj - The object
sqlTypeCode - The corresponding source type code
Returns:
The textual representation
Throws:
ConversionException


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.