dbTalk Databases Forums  

[BUGS] BUG #1073: JDBC "time with time zone"

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1073: JDBC "time with time zone" in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1073: JDBC "time with time zone" - 02-05-2004 , 06:41 AM







The following bug has been logged online:

Bug reference: 1073
Logged by: Bob Messenger

Email address: bob (AT) cassiancapital (DOT) com

PostgreSQL version: 7.5 Dev

Operating system: Linux

Description: JDBC "time with time zone"

Details:

create table a(b time with time zone);

insert into a values ('00:00:00');

import java.sql.*;

public class JDBC
{
public JDBC()
throws Exception
{
Class.forName("org.postgresql.Driver");
DriverManager.setLogStream(System.out);
Connection db =
DriverManager.getConnection("jdbcostgresql://blah/blah?loglevel=3",
"postgres", null);

Statement st = db.createStatement();
ResultSet rs = st.executeQuery("SELECT b FROM a");
while (rs.next())
{
System.out.println(rs.getString(1));
System.out.println(rs.getTimestamp(1));
}
rs.close();
st.close();
db.close();
}

public final static void main(String args[])
throws Exception
{
new JDBC();
}
}

getConnection returning
driver[className=org.postgresql.Driver,org.postgresql.Dri ver@16f0472]
00:00:00+00
Exception in thread "main" org.postgresql.util.PSQLException: Bad Timestamp
Format at 2 in 00:00:00+00
org.postgresql.jdbc1.AbstractJdbc1ResultSet.toTime stamp(AbstractJdbc1Result
at Set.java:1183)
org.postgresql.jdbc1.AbstractJdbc1ResultSet.getTim estamp(AbstractJdbc1Resul
at tSet.java:376)
at JDBC.<init>(JDBC.java:17)
at JDBC.main(JDBC.java:27)



---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply With Quote
  #2  
Old   
Kris Jurka
 
Posts: n/a

Default Re: [BUGS] BUG #1073: JDBC "time with time zone" - 02-06-2004 , 07:33 AM








Quote:
Bug reference: 1073
Logged by: Bob Messenger
Email address: bob (AT) cassiancapital (DOT) com
Description: JDBC "time with time zone"

Details:

create table a(b time with time zone);

insert into a values ('00:00:00');

System.out.println(rs.getTimestamp(1));

Exception in thread "main" org.postgresql.util.PSQLException: Bad Timestamp
Format at 2 in 00:00:00+00
I have confirmed this bug. getTimestamp handles neither time nor timetz,
getTime also does not handle timetz. The fix for this is a little
complicated as the date/time/timestamp parsing is kind of messy, but I
will try to have a patch for this sometime this weekend.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.