Results 1 to 1 of 1
  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Unanswered: Problem with characters ASCII value 128 - 159

    Hi. I'm working on a web service (JSP) that queries data from several database in different countries using different code pages. I have a particular problem which I've narrowed down to a Java or JDBC problem by building a simple query app with java (no JSP or tomcat involved). The database causing the problem has NLS_CHARACTERSET = EE8ISO8859P2 and I’ve tried several values for NLS_LANG including EE8ISO8859P2 (as produces the correct results in TOAD) and UTF8. If I do a simple select chr(138) from dual I expect to get 'Š' (S with upside-down circumflex) returned as I do in TOAD but instead I get a block symbol '�' (value 65533 when cast to int in java). If I do 'insert chr(138) into table' using JDBC the correct character gets inserted so I think the problem occurs during the conversion of the result set values to their Unicode representation. I retrieve the values using resultset.getString(), if I use getBytes() and look at the first byte the value is -17 instead of 138 which is what I would expect. ----- I've done many tests using different client systems and accessing various databases and using various NLS_LANG values (OCI and thin client) but I always get the same results. Performing a simple select chr(nnn) from dual using a value nnn between 128 and 159 returns an unrecognizable character in Java/JDBC. The same query in TOAD returns a correct character depending on the database and NLS_LANG setting. Is this a Java/JDBC bug. Can anyone verify this? Thanks Conleth
    Last edited by conleth; 12-17-03 at 10:47.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •