Thread: hebrew and postgre

hebrew and postgre

From
"Shay"
Date:
hello,

i am trying to write and read from and to postgre,
i am able to do this through PG Explorer, but when i try this code through
JDBC and Jboss it failes:

java.sql.Statement st = connection.createStatement();
java.sql.ResultSet rs = st.executeQuery("SELECT * FROM users where
name='hebrew letters here'");
while(rs.next()) {
    System.out.print("Column 1 returned ");
    System.out.println(rs.getString("name"));
}
rs.close();
st.close();

for some reason the result set is empty altough the PG Explorer can find it

can you help?

thanks ahead,
    Shay.


Re: hebrew and postgre

From
Marc Lavergne
Date:
It could be a million things, my stab at the obvious is are you sure
this is the table you want? Could it be that you want the following?:

...
... select * from pg_user where usename = ...
...
... rs.getString("usename") ...
...

I've used PG 7.2.0 with JBoss and it works fine, so it's very likely
something specific to your application.

Marc

Shay wrote:

> hello,
>
> i am trying to write and read from and to postgre,
> i am able to do this through PG Explorer, but when i try this code through
> JDBC and Jboss it failes:
>
> java.sql.Statement st = connection.createStatement();
> java.sql.ResultSet rs = st.executeQuery("SELECT * FROM users where
> name='hebrew letters here'");
> while(rs.next()) {
>     System.out.print("Column 1 returned ");
>     System.out.println(rs.getString("name"));
> }
> rs.close();
> st.close();
>
> for some reason the result set is empty altough the PG Explorer can find it
>
> can you help?
>
> thanks ahead,
>     Shay.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>