JDBC thin client does not convert to UTF8
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: JDBC thin client does not convert to UTF8

  1. #1
    Join Date
    Dec 2000
    Posts
    43

    Lightbulb

    Hi.
    This is the text of TAR I submitted to support but it looks like they do not sure what is this and have no answer.
    The summary of problem is:
    'I did specify the way it does it - it converts one single 3-byte UTF8 character into 3 pairs of double-byte WE8ISO8859P1 converted characters'.

    Please, help me if you know how to do it correctly.

    -------------------------------------------------------------------

    17-JUL-02 16:03:03 GMT


    Can you easily recover from, bypass or work around the problem? = YES
    Does your system or application continue normally after the problem occurs? =
    YES
    Are the standard features of the system or application still available; is the
    loss of service minor? = YES

    ### Please provide a detailed description of your problem or question. Include
    WE need to insert UTF8 encoded info from JSP page to Oracle,
    we used to have WE8ISO8859P1 info before and now we need UTF8.
    Databse was UTF8 all the time.
    We had the following syntax in JSP pages:
    String standard_text = request.getParameter("group_standard_text");
    I order to support UTF8 developors added
    <%response.setContentType("text/html; charset=UTF-8");%>
    tag for page content type and they expected all data to be automatically
    converted ti UTF8, but it didn`t happen.
    The following method I found on metalink works, nevertheless:
    String standard_text = request.getParameter("group_standard_text");
    standard_text = new String(standard_text.getBytes(), "UTF-8");
    What do we need to do to aboid the specified method?
    Why system does not convert all the data automatically?

    ### Is this a JDBC or SQLJ application? ###
    JDBC

    ### Is this a new or existing installation? ###
    Existing

    ### Is this a compile time or runtime error? ###
    Unknown

    ### Do the JDBC or SQLJ (whichever is applicable) samples work? ###
    Yes

    ### Has this application program ever worked? ###
    Yes

    ### What is the client platform? ###
    IE 5.50, Iplanet6 on sun solaris 5.6, oracle 8.1.7.4 standart edition

    ### Which type of JDBC driver are you using? ###
    JDBC/KPRB (server-side)

    ### What is the JDBC Driver Version? (for JDBC/KPRB, this is same as server ver
    the latest one for 9i database.

    ### What is the JDK Version? (if server-side driver, please indicate server ve
    1.3.1.0.3

    ### What is the current value of the CLASSPATH environment variable? ###
    for what user? I don`t see one for oracle user on oracle instance host.

    ### What is the current value of LD_LIBRARY_PATH? (For JDBC/OCI) ###
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/ccs/lib:/usr/ucb/lib:/usr/local/lib

    ### If you are on HP-UX, what is the current value of SHLIB_PATH? (For JDBC/OCI
    -

    ### Are you able to connect? (If not, try following Note 94091.1.) ###
    Yes

    ### What is happening in the program when the error occurs? (For example, what
    JSP page does insert something unpredictable instead of valid utf8 encoded
    multibyte charaters.
    Need an advice how to workaround this problem and force it to work
    Text continued in next action...


    17-JUL-02 16:03:10 GMT

    Text continued from previous action...

    automatically without forced manually specified trasnlations.

    ### Please list all of the error numbers and their text messages you are receiv
    -

    ### If you are getting ORA-3113 errors, are there additional errors in the aler
    Unknown

    Contact me via : E-mail -> putkin@vertisinc.com


    18-JUL-02 14:50:07 GMT

    New info : This is the example of current system behaviour:
    we have a UTF8 data like
    ⿢ Good bullet 1
    (of course we did see a good single bullet character on the screen, I did show
    the data from database in the way I do see it in Toad utility - but on the web
    page we did see a single bullet character)
    we do copy it into page, issue insert operation and I do see this in the
    database:
    â¿¢ Good bullet 1
    So, each utf8 character was converted into double-byte something - so after
    insert operation we do see a three-character something on the web page,
    so, it makes me beleive that JDBC still does 'WE8ISO8859P1' type convertion
    instead of 'UTF8' type convertion but I don`t understand why.
    I hope this is the all information you need.


    19-JUL-02 13:36:06 GMT

    New info : At the very beginning of this TAR I did specify the way how to avoid
    this problem, so, it is possible to do it correctly.
    The only problem is - this way demands a lot of application code changes and
    Oracle documentation promises that this mechanism should work automatically and
    JDBC 'knows' that character set do I have in the database and able to do such a
    job automatically.
    Any suggestions? Do you have a _working_ example of UTF8 compliant JSP
    application setup working throw JDBC thin client?


    19-JUL-02 13:53:31 GMT

    Hello Paul,
    There are four places where this data could be incorrect.
    1. database
    2. jdbc
    3. jsp
    4. browser

    The first thing to do is to isolate the issue by trying it with a stand-alone Java/JDBC program.
    Also, take a look at the database and dump the column.

    We do not have a working example of UTF8 and JSP.

    Other questions;
    - what column type is this data stored in?
    Is it a CLOB, VARCHAR, etc.?

    - is the JSP simply reading the data already stored or is it also doing the storage of the data?

    Also, you mentioned finding a work-around on Metalink.
    Please give me the details of the note or ducment ID you found.

    Thanks Mac McDermid



    19-JUL-02 13:55:11 GMT

    Email Update button has been pressed -- Sending email.
    22-JUL-02 07:59:33 : CHANGES MADE VIA MetaLink
    NOT YET FORWARDED TO OUR INTERNAL SYSTEMS :

    New info : >Hello Paul,
    >There are four places where this data could be incorrect.
    >1. database
    >2. jdbc
    >3. jsp
    >4. browser
    I have a feeling that you don`t understand me.
    Data is correct everythere.
    It`s not a database issue and it never was a database issue. Database just
    stores the data it gets. If it gets propertly encoded data - it stores it just
    fine and I did specify the way we do it now in the biginning of TAR.
    I have a feeling what it may be something about the way JDBC thin client gets
    NLS_LANG configuration for encoding - but I didn`t find any info about it.
    So, I would exclude database from this issue, and I doubt it may be JSP or
    browser, it`s possible, but probaility is not too much.
    >The first thing to do is to isolate the issue by trying it with a stand-alone
    >Java/JDBC program.
    >Also, take a look at the database and dump the column.
    I did check it already and posted results here.
    >We do not have a working example of UTF8 and JSP.
    Too bad. I afraid this is the only way to understand what it going on.
    >Other questions;
    >- what column type is this data stored in?
    >Is it a CLOB, VARCHAR, etc.?
    The column is varchar2, naturally, sorry, I forgot to specify this.
    >- is the JSP simply reading the data already stored or is it also doing the
    >storage of the data?
    this is OLTP application - typically JSP selects data from database, shows data
    for edit and writes it back to the database. Of course, JSP can get new data
    from user input and store it as well. All this works just fine except final
    stage - if I have propertly encoded data in the database it displays it good,
    but then it encodes it into something else.
    I did specify the way it does it - it converts one single 3-byte UTF8 character
    into 3 pairs of double-byte WE8ISO8859P1 converted characters.
    This is the only problem I have.
    I`m just asking how to force JDBC thin client to encode data proportly into
    UTF8.

    >Also, you mentioned finding a work-around on Metalink.
    >Please give me the details of the note or ducment ID you found.
    I don`t remember now where did I found this. It was just a search for the same
    issue - 'JDBC thin client does not do a data convertion propertly'.

  2. #2
    Join Date
    Dec 2000
    Posts
    43

    same issue

    Looks like nobody is able to say anuthing good.

    This is slightly more info about the same issue - this is the way the data does appear in the database and question is - what to do about it.

    'optional_text' has the original data, 'standart_text' has data that was saved by application - if I copy and paste this UTF8 characters from other source what is UTF8 - result will be the same.

    Connected to:

    Oracle8i Release 8.1.7.4.0 - Production

    JServer Release 8.1.7.4.0 - Production



    SQL> select DUMP(standard_text, 1017) from en_equipment_info where equipment_id
    = 770;


    DUMP(STANDARD_TEXT,1017)

    --------------------------------------------------------------------------------

    Typ=1 Len=130 CharacterSet=UTF8: c3,a2,c2,80,c2,a2, , ,B,a,d, ,b,u,l,l,e,t,
    ,1,^
    M,^J,T,h,e,y,c3,a2,c2,80,c2,99,r,e, ,b,a,d,
    ,a,p,o,s,t,r,o,p,h,e,^M,^J,c3,a2,c2,
    84,c2,a2, ,B,a,d, ,T,r,a,d,e,m,a,r,k,^M,^J,B,a,d, ,c3,a2,c2,80,c2,93,
    ,d,a,s,h,^
    M,^J,c3,a2,c2,80,c2,a2, ,B,a,d, ,b,u,l,l,e,t, ,2,c3,a2,c2,84,c2,a2,B,a,d,
    ,t,r,a
    ,d,e,m,a,r,k, ,2





    SQL> select DUMP(optional_text, 1017) from en_equipment_info where equipment_id
    = 770;


    DUMP(OPTIONAL_TEXT,1017)

    --------------------------------------------------------------------------------

    Typ=1 Len=112 CharacterSet=UTF8: e2,80,a2, , ,B,a,d, ,b,u,l,l,e,t,
    ,1,^M,^J,T,h,
    e,y,e2,80,99,r,e, ,b,a,d, ,a,p,o,s,t,r,o,p,h,e,^M,^J,e2,84,a2, ,B,a,d,
    ,T,r,a,d,
    e,m,a,r,k,^M,^J,B,a,d, ,e2,80,93, ,d,a,s,h,^M,^J,e2,80,a2, ,B,a,d,
    ,b,u,l,l,e,t,
    ,2,e2,84,a2,B,a,d, ,t,r,a,d,e,m,a,r,k, ,2





    SQL>


Posting Permissions

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



Click Here to Expand Forum to Full Width