On Mon, 17 May 2004 15:45:12 -0500 (EST)
Kris Jurka <books(at)ejurka(dot)com> wrote:
> > [timestamps like 0002-10-30 are incorrectly seen as 2030-02-10].
> Yes, that's a bug alright. I've fixed this in both the stable and
> development cvs trees. While looking at this I noticed that the
> timestamp code has no provisions for BC dates, so if you're working
> with years in that area, that's something to be aware of. Fixing that
> has gone on the todo list, but I wanted to get this fix out to you
I just notified the change in the JDBC CVS, and have a (very small)
sbuf.append("0") is less efficient than sbuf.append('0').
The first reason is that for storing "0", there is a String object
created by the jvm, with an associated internal char array, which is
bound to the Class instance, while '0' as a constant scalar character is
no extra object.
And the second reason is that, as the StringBuffer source shows, adding
a String to a StringBuffer is much more work including a call to
System.ArrayCopy, while adding a simple character is just ensuring the
capacity and putting it in.
Interestingly, the lines below your insertion, already use chars, while
a little bit above, there's another example adding a single-byte String
(maybe because of lazyness to quote a ' inside of '').
So if you feel like peephole-optimizing, you can apply the attached
patch, if not, don't mind.
Thanks for your patience,
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios(at)logi-track(dot)com | www.logi-track.com
In response to
pgsql-jdbc by date
|Next:||From: ow||Date: 2004-05-19 20:20:42|
|Subject: Re: [BUG?] Extreme dates|
|Previous:||From: Alban Mathieu||Date: 2004-05-19 13:23:58|
|Subject: Driver JDBC3 build 213 for postgreSQL 7.4|