com.novell.nds.dirxml.driver.jdbc.db
Class DBTimestamp

java.lang.Object
  extended bycom.novell.nds.dirxml.driver.jdbc.db.AbstractTimeValue
      extended bycom.novell.nds.dirxml.driver.jdbc.db.DBTimestamp
All Implemented Interfaces:
DBTimeTranslator
Direct Known Subclasses:
DB2Timestamp, SybaseTimestamp

public class DBTimestamp
extends AbstractTimeValue
implements DBTimeTranslator

An abstract database timestamp.


Field Summary
 
Fields inherited from interface com.novell.nds.dirxml.driver.jdbc.db.DBTimeTranslator
CLASS_DATE, CLASS_TIME, CLASS_TIMESTAMP
 
Constructor Summary
DBTimestamp(String dbTimestamp, String sqlClass, String inFormat, String outFormat)
           
 
Method Summary
 String getDSTime()
          Returns this timestamp/date/time value in the directory canonical string format (e.g. CCYYMMDDHHMMSSNNNNNNNNN, CCYYMMDD or HHMMSS) or in the 32-bit integer string format (e.g. "1013368206"), if translation was successful.
 boolean precisionLost()
          Indicates whether precision was lost converting this timestamp to a directory timestamp.
 void setDSTime(String nativeTime)
          Translates a database-native timestamp/date/time value into an equivalent directory format as per the arguments passed to the constructor.
 
Methods inherited from class com.novell.nds.dirxml.driver.jdbc.db.AbstractTimeValue
getErrorMessage, getExceptions, parseError
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.novell.nds.dirxml.driver.jdbc.db.DBTimeTranslator
getErrorMessage, getExceptions, parseError
 

Constructor Detail

DBTimestamp

public DBTimestamp(String dbTimestamp,
                   String sqlClass,
                   String inFormat,
                   String outFormat)
Method Detail

setDSTime

public void setDSTime(String nativeTime)
               throws ParseException
Description copied from interface: DBTimeTranslator
Translates a database-native timestamp/date/time value into an equivalent directory format as per the arguments passed to the constructor.

Specified by:
setDSTime in interface DBTimeTranslator
Parameters:
nativeTime - a database-native timestamp, date, or time value; may be null
Throws:
ParseException

precisionLost

public boolean precisionLost()
Indicates whether precision was lost converting this timestamp to a directory timestamp.

Specified by:
precisionLost in interface DBTimeTranslator
Returns:
true if precision was lost; false otherwise

getDSTime

public String getDSTime()
Description copied from interface: DBTimeTranslator
Returns this timestamp/date/time value in the directory canonical string format (e.g. CCYYMMDDHHMMSSNNNNNNNNN, CCYYMMDD or HHMMSS) or in the 32-bit integer string format (e.g. "1013368206"), if translation was successful.

Specified by:
getDSTime in interface DBTimeTranslator
Returns:
an equivalent directory canonical string value (e.g. "20010101000000000000000", "20010101" or "000000") or a 32-bit integer string value (e.g. "1013368206") if conversion was successful; a native database timestamp otherwise; never returns null