Home > Archive > PostgreSQL JDBC > January 2006 > jdbc problem









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 jdbc problem
Gilbert, Antoine

2006-01-16, 11:29 am

Hi



I'am fetching records via the PostgreSQL JDBC driver.



I have a strange problem. The string values always have some blank
characters (or tab?) at the end.



So if I have in the database 'British Columbia', it become in my java
program with rs.getString() something like 'British Columbia '.



The select I'm using is basic : select Province_name from myTable



When I try this query in the PostgreSQL admin console, I don't have this
problem.



Any idea?




Roland Walter

2006-01-16, 11:29 am

Gilbert, Antoine schrieb:

> Hi
>
>
>
> I'am fetching records via the PostgreSQL JDBC driver.
>
>
>
> I have a strange problem. The string values always have some blank
> characters (or tab?) at the end.
>
>
>
> So if I have in the database 'British Columbia', it become in my java
> program with rs.getString() something like 'British Columbia '.
>
>
>
> The select I'm using is basic : select Province_name from myTable
>
>
>
> When I try this query in the PostgreSQL admin console, I don't have
> this problem.
>
>
>
> Any idea?
>
>
>

This is correct if the type of Province_name is char(xx) and the column
width xx is longer than the value.

--
Roland Walter mailto: rwa (at) mosaic-ag (dot) com
MOSAIC SOFTWARE AG phone: +49 (0) 22 25 / 88 2-41 1
Am Pannacker 3 fax: +49 (0) 22 25 / 88 2-20 1
D-53340 Meckenheim http://www.mosaic-ag.com



Die in dieser E-Mail enthaltenen Nachrichten und Anhaenge sind ausschliesslich
fuer den bezeichneten Adressaten bestimmt. Sie koennen rechtlich geschuetzte,
vertrauliche Informationen enthalten. Falls Sie nicht der bezeichnete Empfaenger
oder zum Empfang dieser E-Mail nicht berechtigt sind, ist die Verwendung,
Vervielfaeltigung oder Weitergabe von Nachrichten und Anhaengen untersagt.
Falls Sie diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte
unverzueglich den Absender und vernichten Sie die E-Mail.

This e-mail message and any attachment are intended exclusively for the named
addressee. They may contain confidential information which may also be protected
by professional secrecy. Unless you are the named addressee (or authorised to
receive for the addressee) you may not copy or use this message or any attachment
or disclose the contents to anyone else. If this e-mail was sent to you by mistake
please notify the sender immediately and delete this e-mail.


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