Here you can find the source of getCurrentDBTimestamp()
public static Timestamp getCurrentDBTimestamp()
//package com.java2s; //License from project: Apache License import java.sql.*; import java.text.SimpleDateFormat; public class Main { /**/* w ww .j a va 2s . c o m*/ * Method to return current db time in Timestamp formate * * @return Timestamp db timestamp format */ public static Timestamp getCurrentDBTimestamp() { SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); String strDate = simple.format(new java.util.Date()); Timestamp timestamp = Timestamp.valueOf(strDate); return timestamp; } }