com.fatwire.cs.core.db
Class Util

java.lang.Object
  extended by com.fatwire.cs.core.db.Util

public final class Util
extends java.lang.Object

Handy utility class for working with databases.

Since:
12-Jan-2007 9:57:05 PM

Method Summary
static java.lang.String formatJdbcDate(java.util.Date date)
          Given a Date, return a string in the standard jdbc form: yyyy-MM-dd HH:mm:ss
static java.util.Date parseJdbcDate(java.lang.String string)
          Given an input string in JDBC form, parse it and return a date object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

formatJdbcDate

public static java.lang.String formatJdbcDate(java.util.Date date)
Given a Date, return a string in the standard jdbc form: yyyy-MM-dd HH:mm:ss

Parameters:
date - input date
Returns:
jdbc-formatted string

parseJdbcDate

public static java.util.Date parseJdbcDate(java.lang.String string)
Given an input string in JDBC form, parse it and return a date object.

Parameters:
string - jdbc date string in the form yyyy-MM-dd HH:mm:ss
Returns:
Date
Throws:
java.lang.IllegalArgumentException - on failure