Bug #622: jdbc driver exception: failed to get datetime field from a table - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Bug #622: jdbc driver exception: failed to get datetime field from a table
Date
Msg-id 20020318171809.CBAC8479251@postgresql.org
Whole thread Raw
List pgsql-bugs
Zhou Hui Qing (suzi9999@yeah.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:

Previous
From: Darcy Buskermolen
Date:
Subject: Re: Bug #621: why postgreSQL stored databases in
Next
From: Bruce Momjian
Date:
Subject: Re: psql's \r does not reset parenthesis depth counter