Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6345277

JDBC-ODBC Bridge still does not support Unicode UTF-16

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Fix
    • P4
    • None
    • 5.0
    • core-libs

    Description

      FULL PRODUCT VERSION :
      java version "1.5.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
      Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      JDBC-ODBC Bridge still does not support Unicode UTF-16, which is the charset used by MS Access 2000/2003. Since the DB is installed on most Windows PC, it's naturally the one developers/users prefer for their personal desktop DB applications. A lot of Unicode/Access-related questions have been asked on Java JDBC Forum, and a few bug reports (4340942) were also submitted. It's highly desirable that this bug be fixed.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Follow the instructions given in http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/bridge.html

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It should enable connection to MS Access 2000/2003 and allow retrieve/update of Unicode text data.
      ACTUAL -
      Exceptions thrown.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.sql.SQLException:
          at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
          at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
          at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3074)
          at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
          at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
          at java.sql.DriverManager.getConnection(DriverManager.java:525)
          at java.sql.DriverManager.getConnection(DriverManager.java:140)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
             // Load the JDBC-ODBC bridge driver
             Class.forName(sun.jdbc.odbc.JdbcOdbcDriver) ;
             String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=Northwind.mdb";

             // setup the properties
             java.util.Properties prop = new java.util.Properties();
             prop.put("charSet", "UTF-16");
             prop.put("user", username);
             prop.put("password", password);
       
             // Connect to the database
             con = DriverManager.getConnection(url, prop);
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No workaround.

      Alternative charsets, such as UnicodeBig, UnicodeLittle, produced the same exceptions.

      UTF8 yielded the connection, but since Access DB charset is UTF-16, the data were retrieved/updated corrupted.

      Attachments

        Activity

          People

            lancea Lance Andersen
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: