From: <ch...@op...> - 2004-05-10 02:30:09
|
> Alle 11:57, domenica 9 maggio 2004, ch...@op... ha scritto: > > > The one problem is that the driver needs to be patched for the > encoding. > > Way back when I tried to email the pgsql-jdbc list about this, > and > > got no response. I need to email them again and submit a patch, > maybe > > with refraction's help, but I never got around to it. The end of > > http://jira.codehaus.org/secure/ViewIssue.jspa?key=GEOT-137 has a > > comment about it: > > > > 'The BaseDataSource (org.postgresql.jdbc2.optional) class needs an > extra > > field, two more methods, and one more line. Basically you need > getter > > and setter methods for the charSet (I called it encoding), and then > for > > the getConnection method you just need a line that says > > 'props.put("charSet", encoding); There is already support in jdbc1 > for > > charSets, they just didn't bother to put accessors for > jdbc2.optional.' > > > > In the current code it's called getEncoding and setEncoding, but > > getCharSet and setCharSet are probably more appropriate names. So > > yeah, if those aren't in there then I think some existing code may > > break, at least in GeoServer it will, I may have never got a unit > test > > into geotools (sorry). If anyone does get the change into the > pgsql > > jdbc driver then please close the bug. > > Chris, also, is it possible to get the same effect by calling 'set > client_encoding = "xxx"' with a statement before starting to use > the connection (that is, something that should be managed at the > connection pool level I guess, or at least by creating a factory > method > on the postgis data store that provides connection with the right > encoding for everybody?). If that could work we could get along with > an unpatched driver... I doubt it, as it is set per connection, it's not global. I'll try to get the patch to you soon, I'm way behind on geotools/server, and the last version that I patched was just a decompiled one, so I'll need to download the source again and redo it. I can def. get it to you within a week (or I can do all the emailing and uploading myself, and send you the jar to make sure it works on your branch. You're using the driver downloaded from the jdbc website, right?). If you want it sooner I can tell you exactly how to do it, as it really is quite trivial, just getter and setter methods and making sure it gets into the props for the jdbc1 connection. Chris > > I'm referencing the postgres documentation at: > http://www.postgresql.org/docs/7.4/interactive/runtime-config.html > > Best regards > Andrea Aime > > > ------------------------------------------------------- > This SF.Net email is sponsored by Sleepycat Software > Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to > deliver > higher performing products faster, at low TCO. > http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 > _______________________________________________ > Geotools-devel mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-devel > ---------------------------------------------------------- This mail sent through IMP: https://webmail.limegroup.com/ |