Here you can find the source of formatWithSql92Date(Date date)
public static String formatWithSql92Date(Date date)
//package com.java2s; /**// w w w . jav a2s . c om * Copyright 2003 ZhongTian, Inc. All rights reserved. * * qingdao tec PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * $Id: DBUtil.java,v 1.1 2006/05/17 09:19:30 wiserd Exp $ * File:DBUtil.java * Date Author Changes * March 10 2003 wangdeliang Created */ import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String formatWithSql92Date(Date date) { if (date != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh : mm : ss"); return "{ts '" + sdf.format(date) + "'}"; } else { return "NULL"; } } }