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

Bug #622: jdbc driver exception: failed to get datetime field from a table

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #622: jdbc driver exception: failed to get datetime field from a table
Date: 2002-03-18 17:18:09
Message-ID: 20020318171809.CBAC8479251@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Zhou Hui Qing (suzi9999(at)yeah(dot)net) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
jdbc driver exception: failed to get datetime field from a table

Long Description
platform: SuSE 7.3 , Win2000 Server + cygwin !

When I using the example 'psql' (java example.psql jdbc:postgresql:mydb postgres postgres) to retrive data from the table 'test' (select * from test) , I got an exception:

java.lang.StringIndexOutOfBoundsException: String index out of range: 23
java.lang.StringIndexOutOfBoundsException: String index out of range: 23
        at java.lang.String.charAt(String.java:455)
        at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653)
        at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java:398)
        at org.postgresql.jdbc2.ResultSet.getObject(ResultSet.java:768)
        at example.psql.displayResult(psql.java:137)
        at example.psql.processLine(psql.java:96)
        at example.psql.<init>(psql.java:62)
        at example.psql.main(psql.java:227)

Sample Code
java example.psql jdbc:postgresql:mydb postgres postgres

create table test(id serial primary key , name varchar(20) , dt datetime default now() );

insert into test (name) values ('my name');

select * from test;

--got an error!


No file was uploaded with this report


pgsql-bugs by date

Next:From: Bruce MomjianDate: 2002-03-19 00:13:05
Subject: Re: psql's \r does not reset parenthesis depth counter
Previous:From: Darcy BuskermolenDate: 2002-03-18 16:54:41
Subject: Re: Bug #621: why postgreSQL stored databases in

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