Tomcat, JSP and AS400JDBCDriver - IBM AS400

This is a discussion on Tomcat, JSP and AS400JDBCDriver - IBM AS400 ; Hello group, I have managed to install and configure Tomcat 5.5 on V5r3 and it is running great. I also have some simple test JSP page to read and populate database table from browser. It is also working great except ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Tomcat, JSP and AS400JDBCDriver

  1. Tomcat, JSP and AS400JDBCDriver

    Hello group,

    I have managed to install and configure Tomcat 5.5 on V5r3 and it is running
    great.
    I also have some simple test JSP page to read and populate database table
    from browser.
    It is also working great except one thing...character encodning.

    Please, if anyone knows how to solve the problem?!

    We are using CCSID 870 on our table also as on our system and this codepage
    need to be
    converted to WINDOWS-1250 or UTF-8 to get Eastern European characters.

    There is configuration parameters of context.xml



    type="javax.sql.DataSource"
    driverClassName="com.ibm.as400.access.AS400JDBCDriver"
    url="jdbc:as400://localhost"
    maxActive="8"/>







  2. Re: Tomcat, JSP and AS400JDBCDriver

    "niko" writes:

    > It is also working great except one thing...character encodning.
    >
    > Please, if anyone knows how to solve the problem?!
    >
    > We are using CCSID 870 on our table also as on our system and this codepage
    > need to be
    > converted to WINDOWS-1250 or UTF-8 to get Eastern European characters.
    >
    > There is configuration parameters of context.xml
    >
    >
    >
    > > type="javax.sql.DataSource"
    > driverClassName="com.ibm.as400.access.AS400JDBCDriver"
    > url="jdbc:as400://localhost"


    You can provide properties to the JDBC driver in the URL, one of these
    being the code page.

    See
    http://publib.boulder.ibm.com/infoce...properties.htm
    for the properties available in V5R4.
    --
    Thorbjørn Ravn Andersen

  3. Re: Tomcat, JSP and AS400JDBCDriver

    Thank's, but...
    Only available encoding parameter is "package ccsid" which can be set only
    to UTF-16 or UCS-2.
    And this is not available on v5r3 or less?!?!? Never mind...Java strings
    works with unicode so
    I need to convert it to appropriate code page .

    Incoming data is in UTF-16 and if I set the following in top of JSP
    page....

    <%@ page language="java" contentType="text/html; charset=WINDOWS-1250" %>

    I get good characteers in my browser. Now only remains problem with sending
    data back?!

    When I have FORM tag and using post to update database, data is not
    converted to CCSID 870?!
    I found great description for this ...
    http://java.sun.com/j2ee/1.4/docs/tu.../WebI18N5.html

    For web components, three encodings must be considered:
    Request
    Page (JSP pages)
    Response

    So what I need is proper encoding for request/response ?!?!?

    Niko




  4. Re: Tomcat, JSP and AS400JDBCDriver

    "niko" writes:

    > I need to convert it to appropriate code page .


    It sounds to me that your problem is with sending out information.
    The windows-1250 encoding is not standard. I would recommend getting
    the utf-8 encoding to work properly since you will then have solved
    your problem for good.

    Regarding upload the 870 code page conversion should be done by the
    jdbc driver, so all that you need is to provide the correct unicode
    characters. Are you certain that this works correctly?

    You may want to use <% System.out.println("....") %> to get lines in
    your log file.
    --
    Thorbjørn Ravn Andersen

  5. Re: Tomcat, JSP and AS400JDBCDriver

    hi,

    I have done additional tests, and...
    It seems that conversion is good, data sent from page to as400 jdbc driver
    is in UTF-16
    but when driver writes data to file, they are written in DBCS (UTF-16) ?!

    I think that driver it self does not convert from UTF-16 to appropriate 870
    code page.
    Maybe there is some parameter I need to set up, but I don't know what.


    Niko.



  6. Re: Tomcat, JSP and AS400JDBCDriver

    "niko" writes:

    > hi,
    >
    > I have done additional tests, and...
    > It seems that conversion is good, data sent from page to as400 jdbc driver
    > is in UTF-16
    > but when driver writes data to file, they are written in DBCS (UTF-16) ?!


    So you have localized the problem to be in the jdbc-driver?

    In that case, you can ask in the java toolbox forum at IBM, where the
    developers of the toolbox are very helpful
    --
    Thorbjørn Ravn Andersen

  7. Re: Tomcat, JSP and AS400JDBCDriver


    Thanks Thorbjørn for help!

    Niko.



+ Reply to Thread