Home > Archive > PostgreSQL JDBC > January 2006 > bug in getTime after insertRow with postgresql-8.1-404.jdbc3.jar









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author bug in getTime after insertRow with postgresql-8.1-404.jdbc3.jar
hpb@htl-steyr.ac.at

2006-01-05, 7:23 am

hi,

I suspect, I bumpt into a bug with insertRow.

Here is my java code:

-------------------------------snipp-------------------------------
System.out.println("millisec before
update:"+((java.sql.Time)rs. getTime(dbAttribute)
).getTime());

rs. updateTime(dbAttribu
te, new java.sql.Time( (
(java.util.Date)this.theValue).getTime()));

System.out.println("millisec after
update:"+((java.sql.Time)rs. getTime(dbAttribute)
).getTime());

...
...
...


System.out.println("millisec before
insertRow:"+((java.sql.Time)this.db.rs.getTime("ist_von")).getTime());

this.db.rs.insertRow(); //write the actual insert row to table

System.out.println("millisec after
insertRow:"+((java.sql.Time)this.db.rs.getTime("ist_von")).getTime());
-------------------------------snipp-------------------------------

the output is

-------------------------------snipp-------------------------------
millisec before update:60000
millisec after update:60000
millisec before insertRow:60000
millisec after insertRow:3660000
-------------------------------snipp-------------------------------

what indicates that after the insertRow my timezone is added CET -> one
hour more -> 3600000 msec
if I use postgresql-8.0-314.jdbc3.jar
it behaves normal ->

-------------------------------snipp-------------------------------
millisec before update:60000
millisec after update:60000
millisec before insertRow:60000
millisec after insertRow:60000
-------------------------------snipp-------------------------------

thanks for any help

hpb



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

hpb@htl-steyr.ac.at

2006-01-05, 11:24 am

Funny! If I use
postgresql-8.0-314.jdbc3.jar
it works fine
if I use
postgresql-8.1-404.jdbc3.jar
it shows this error.

May be that there is another issue than the driver ??????


hpb


Pradeep Sharma schrieb:
> Which driver you are currently using. I found the same issue with
> postgresql-8.0-314.jdbc3.jar
>
> After that I am using the latest driver from postgres site, and it seems
> to be working fine.
>
> One thing is sure it is a problem with the driver.
>
> Pradeep
>
> On 1/5/06, *hpb@htl-steyr.ac.at <mailto:hpb@htl-steyr.ac.at>*
> <hpb@htl-steyr.ac.at <mailto:hpb@htl-steyr.ac.at>> wrote:
>
> hi,
>
> I suspect, I bumpt into a bug with insertRow.
>
> Here is my java code:
>
> -------------------------------snipp-------------------------------
> System.out.println("millisec before
> update:"+((java.sql.Time)rs. getTime(dbAttribute)
).getTime());
>
> rs. updateTime(dbAttribu
te, new java.sql.Time( (
> (java.util.Date)this.theValue).getTime()));
>
> System.out.println("millisec after
> update:"+((java.sql.Time)rs. getTime(dbAttribute)
).getTime());
>
> ..
> ..
> ..
>
>
> System.out.println ("millisec before
> insertRow:"+((java.sql.Time)this.db.rs.getTime("ist_von")).getTime());
>
> this.db.rs.insertRow(); //write the actual insert row to table
>
> System.out.println("millisec after
> insertRow:"+((java.sql.Time)this.db.rs.getTime("ist_von")).getTime());
> -------------------------------snipp-------------------------------
>
> the output is
>
> -------------------------------snipp-------------------------------
> millisec before update:60000
> millisec after update:60000
> millisec before insertRow:60000
> millisec after insertRow:3660000
> -------------------------------snipp-------------------------------
>
> what indicates that after the insertRow my timezone is added CET -> one
> hour more -> 3600000 msec
> if I use postgresql-8.0-314.jdbc3.jar
> it behaves normal ->
>
> -------------------------------snipp-------------------------------
> millisec before update:60000
> millisec after update:60000
> millisec before insertRow:60000
> millisec after insertRow:60000
> -------------------------------snipp-------------------------------
>
> thanks for any help
>
> hpb
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql
.org
> < mailto:majordomo@pos
tgresql.org> so that your
> message can get through to the mailing list cleanly
>
>
>
>
> --
> Pradeep Sharma
> In2M Corporation,
> Mumbai
> Mob.- +91-9892853803



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Oliver Jowett

2006-01-05, 8:25 pm

hpb@htl-steyr.ac.at wrote:

> System.out.println("millisec before
> insertRow:"+((java.sql.Time)this.db.rs.getTime("ist_von")).getTime());
>
> this.db.rs.insertRow(); //write the actual insert row to table
>
> System.out.println("millisec after
> insertRow:"+((java.sql.Time)this.db.rs.getTime("ist_von")).getTime());


Is the data actually inserted to the database correctly?

If you re-query it via a different resultset, is it correct?

(IIRC, insertRow() directly updates the Java-side resultset without
requerying the DB, which is why I ask -- I suspect there will be a bug
in that update code)

-O

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

hpb@htl-steyr.ac.at

2006-01-05, 8:25 pm

The data is inserted in the database correctly!
I was thinking about a workaround by doing another select. I didn't I
posted in the newsgroup ;-)

hpb

Oliver Jowett schrieb:

> hpb@htl-steyr.ac.at wrote:
>
>
>
> Is the data actually inserted to the database correctly?
>
> If you re-query it via a different resultset, is it correct?
>
> (IIRC, insertRow() directly updates the Java-side resultset without
> requerying the DB, which is why I ask -- I suspect there will be a bug
> in that update code)
>
> -O



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com