Skip site navigation (1) Skip section navigation (2)

BUG #1073: JDBC "time with time zone"

From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1073: JDBC "time with time zone"
Date: 2004-02-05 12:39:31
Message-ID: 20040205123931.39D1BCF4D6B@www.postgresql.com (view raw or flat)
Thread:
Lists: pgsql-bugs
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("jdbc:postgresql://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(dot)postgresql(dot)Driver(at)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.toTimestamp(AbstractJdbc1Result
        at Set.java:1183) 
org.postgresql.jdbc1.AbstractJdbc1ResultSet.getTimestamp(AbstractJdbc1Resul
        at tSet.java:376) 
        at JDBC.<init>(JDBC.java:17)
        at JDBC.main(JDBC.java:27)



Responses

pgsql-bugs by date

Next:From: Achilleus MantziosDate: 2004-02-05 16:18:45
Subject: IN does not negate, exists does
Previous:From: pgsql-bugsDate: 2004-02-05 11:48:20
Subject: Returned due to virus; was:Status

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group