Date in JDBC

From: Vernon Wu <vernonw(at)gatewaytech(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Date in JDBC
Date: 2002-06-11 03:39:34
Message-ID: E9JMJWB083TS2XUS04WRSOQM2Z653X.3d0570f6@kimiko
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


I am first time using the date type in the jdbc or potgreSQL in general. One field of a DB table is the date type. In a
query string I have:

INSERT INTO account(firstname, status, userid,addr1,addr2,city,province,postcode,email,phone, cellphone, rdate,
notes, lastname) VALUES ('John', 'n', 'rt', ' 340 Road', 'suite 201', 'mycity', 'wa', '98034', '34(at)32(dot)com', '999-888-2222',
'111-222-3333', 'Mon Jun 10 08:42:06 SGT 2002', 'NA', 'familyname')

And I get the error message java.sql.SQLException: ERROR: Bad date external representation 'Mon Jun 10 08:4
2:06 SGT 2002'.

I use the java.util.date to create a new date instance to convert to string. What is the right way to get the date right?

Thanks in advance.

Vernon

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Arthur & Kathy Yeo 2002-06-11 04:34:20 Re: Getting ResultSet using JDBC when calling Stored-Procedures
Previous Message Arthur & Kathy Yeo 2002-06-11 03:25:17 Getting ResultSet using JDBC when calling Stored-Procedures