setTimestamp(int parameterIndex, Timestamp x, Calendar cal) Sets the designated parameter to the given java.sql.Timestamp value, using the given Calendar object. The driver uses the Calendar object to construct an SQL TIMESTAMP value, which the driver then sends to the database. With a a Calendar object, the driver can calculate the timestamp taking into account a custom timezone. If no Calendar object is specified, the driver uses the default timezone, which is that of the virtual machine running the application.
SimpleDateFormat simDate = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
java.util.Date collectTime = new java.util.Date();
String strCollectTime = simDate.format(collectTime );