2 Replies Latest reply on Feb 14, 2007 1:42 PM by weston.price

    JBOSS to DB2 AS400 - dateFormat is not correct

    rickenator

      I am migrating an existing web application ( no ejbs ) from Websphere to JBOSS. Our database is DB2 on the AS400. In our Websphere environment, we had to set a custom property of the datasource, the dateFormat to "iso" in order to display the dates correctly. After moving the apps over to JBOSS, we are having the same problem. I tried to pass this property as a connection-property, ala <connection-property name="dateFormat">iso</connection-property> but it doesn't seem to make a difference.

      I also tried to add it to the connection-url string, as I see some other properties appended, but that has no effect either. Otherwise, the datasource works fine.

      Anyone else have any experience with this issue (dateFormat) ?

      Here is my db2-400-ds.xml file

      <?xml version="1.0" encoding="UTF-8"?>

      <!-- ===================================================================== -->
      <!-- -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- ===================================================================== -->

      <!-- $Id: db2-400-ds.xml,v 1.1.4.2 2004/10/27 18:44:10 pilhuhn Exp $ -->

      <!-- You need the jt400.jar that is delivered with IBM iSeries Access or the
      OpenSource Project jtopen.

      [systemname] Hostame of the iSeries
      [schema] Default schema is needed so jboss could use metadat to test if the tables exists
      -->


      <local-tx-datasource>
      <jndi-name>AS400DS</jndi-name>
      <connection-url>jdbc:as400://WWTEST/WWTEST;extended dynamic=true;package=jbpkg;package cache=true;package library=jboss;errors=full</connection-url>
      <driver-class>com.ibm.as400.access.AS400JDBCDriver</driver-class>
      <user-name>****</user-name>
      ****
      <min-pool-size>5</min-pool-size>
      <!-- sql to call when connection is created
      <new-connection-sql>some arbitrary sql</new-connection-sql>
      -->

      <!-- sql to call on an existing pooled connection when it is obtained from pool
      <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
      -->
      <connection-property name="libraries">ITDATA,GDATA,GHIST,GCOMMON,VAIMODSDTA,R35FILES,VBLIB,WEBAPPS,WEBFINRPT1,WEBFINRPT8,QGPL,WWDATA,CSDATA</connection-property>
      <connection-property name="dateFormat">iso</connection-property>
      <connection-property name="naming">system</connection-property>
      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

      <type-mapping>DB2/400</type-mapping>

      </local-tx-datasource>

        • 1. Re: JBOSS to DB2 AS400 - dateFormat is not correct
          t_skowronek

          I believe we also had problem with dates and ended up specifying the following on the connection-url element when accessing DB2/400.

          date format=iso;time format=iso;extended dynamic=true;package cache=true;errors=full;naming=SYSTEM


          • 2. Re: JBOSS to DB2 AS400 - dateFormat is not correct
            weston.price

            In any type of situation like this I encourage writing a simple test client using straight JDBC, running outside of JBoss. If you can either prove, or disprove that it works, then you will know what to do to get it properly configured and setup. Usually when I see errors like this it's one of two things:

            1) The property you are trying to set is either
            misnamed
            misconfigured
            doesn't exist

            2) The EIS host doesn't understand what you are doing, or the driver itself has some sort of bug that prevents the property from being set/used.