OpenJPA
  1. OpenJPA
  2. OPENJPA-973

Allow DB2 JCC driver to work with Informix database

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 2.0.0-M3
    • Component/s: jdbc
    • Labels:
      None

      Description

      Openjpa parses the DatabaseMetaData retrieved from the jdbc connection to determine the database type. For informix, if db2jcc driver is used, the product name in the DatabaseMetaData does not start with "informix", but with "ids"

        Activity

        Hide
        Fay Wang added a comment -

        Allow com.ibm.db2.jcc.DB2Driver to work with
        Informix. Since this driver can work with both DB2
        and Informix, we need to check url protocol first to determine
        the correct DBDictionary.

        Show
        Fay Wang added a comment - Allow com.ibm.db2.jcc.DB2Driver to work with Informix. Since this driver can work with both DB2 and Informix, we need to check url protocol first to determine the correct DBDictionary.
        Hide
        Donald Woods added a comment -

        Patch applied to trunk on March 23 by Fay and I verified that the DB2 driver could be used with IDS when testing the query timeout featue, so marking as resolved.

        Show
        Donald Woods added a comment - Patch applied to trunk on March 23 by Fay and I verified that the DB2 driver could be used with IDS when testing the query timeout featue, so marking as resolved.
        Hide
        Fay Wang added a comment -

        There is an open issue with db2 jcc driver when connecting to Informix.

        A similar call to getColumns work with both jcc and native jdbc driver:

        ResultSet rs = dbMeta.getColumns("demodb", null, "jpataskbean", null); ==> jcc return columns

        However, the getImportedKeys does not work with jcc driver:

        rs = dbMeta.getImportedKeys("demodb", null, "jpataskbean"); ==> jcc returns empty result set

        There can be two possibilities here.

        The database metadata methods in the driver are implemented by calling a stored procedure on the server. So the problem could be in the in the stored procedure.

        Or since the IDS server supports two different protocols (i.e. sqli and drda). It is possible that getImportedKeys is working in sqli protocol which is used with Informix legacy jdbc driver and not working with drda protocol which is used by JCC driver.

        Either way this does seems to be a JCC driver problem.

        Show
        Fay Wang added a comment - There is an open issue with db2 jcc driver when connecting to Informix. A similar call to getColumns work with both jcc and native jdbc driver: ResultSet rs = dbMeta.getColumns("demodb", null, "jpataskbean", null); ==> jcc return columns However, the getImportedKeys does not work with jcc driver: rs = dbMeta.getImportedKeys("demodb", null, "jpataskbean"); ==> jcc returns empty result set There can be two possibilities here. The database metadata methods in the driver are implemented by calling a stored procedure on the server. So the problem could be in the in the stored procedure. Or since the IDS server supports two different protocols (i.e. sqli and drda). It is possible that getImportedKeys is working in sqli protocol which is used with Informix legacy jdbc driver and not working with drda protocol which is used by JCC driver. Either way this does seems to be a JCC driver problem.
        Hide
        Donald Woods added a comment -

        OK, reopening since there is still an issue.
        BTW - I used the DRDA protocol for query timeout testing on IDS, but didn't run all the unit tests.

        Show
        Donald Woods added a comment - OK, reopening since there is still an issue. BTW - I used the DRDA protocol for query timeout testing on IDS, but didn't run all the unit tests.
        Hide
        Michael Dick added a comment -

        Merged to 1.3.x, I believe the remaining problems are with the JCC driver and this issue can be closed.

        Show
        Michael Dick added a comment - Merged to 1.3.x, I believe the remaining problems are with the JCC driver and this issue can be closed.
        Hide
        Fay Wang added a comment -

        The informix problem of
        rs = dbMeta.getImportedKeys("demodb", null, "jpataskbean"); ==> jcc returns empty result set

        is fixed in 11.50.xC5 fix pack release.

        Show
        Fay Wang added a comment - The informix problem of rs = dbMeta.getImportedKeys("demodb", null, "jpataskbean"); ==> jcc returns empty result set is fixed in 11.50.xC5 fix pack release.

          People

          • Assignee:
            Fay Wang
            Reporter:
            Fay Wang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development