On 27-05-2012 05:37:32 -0700, Majid Azimi wrote:
> But there is no difference between timestamps in database
> and timestamps after converting time zone in application.
> Could anyone help?
> Is this the wrong way to convert TimeZone?
I'm not sure I understand what you want. The example code you showed
looked daft, since you seem to be changing timezones on the fly.
The Driver accomodates for your timezone, that is, the timezone that's
default in your JVM when it makes a connection to the database. If you
want to use another timezone for timestamps/times/dates than the default
of your JVM, then set the desired timezone before creating a new
connection to the database (DriverManager.getConnection()).
If you have a scenario where many timezones are involved in retrieving
and storing timestamps, you probably best use TIMESTAMP WITH TIMEZONE
instead to save yourself a lot of trouble.