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

jdbc-odbc Bridge Chinese(Big5) Bugs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.3.0
    • 1.1.1, 1.2.0, 1.2.1, 1.2.2, 1.3.0
    • core-libs
    • kestrel
    • generic, x86, sparc
    • generic, solaris_2.5.1, windows_95, windows_98, windows_nt



      Name: rm29839 Date: 01/23/98


      In JDK 1.1.5(JDBC-ODBC 1.1001), I can not correctly display the Chinese strings queried from the Access database.
      The Chinese strings I got seemed not Big5 Code, although they are Big5 code in database.
      Furthermore, I can not insert Chinese string to database.

      In JDK 1.2beta2 (JDBC-ODBC 1.2001), luckily, I can queried the Chinese string from database and display it.
      However, I can not insert or update the table with more than one column have Chinese string values.

      You can test it just use the simpleselect.java program.
      (Review ID: 23881)
      ======================================================================

      Name: krT82822 Date: 10/14/99


      10/14/99 eval1127@eng -- committed to be fixed in (final) kestrel, based on bug #'s 4106306, 4106617, as well.

      This report is equal to Bug ID 4053824.

      The reason JDBC-ODBC bridge can't pass DBCS string is that
      sun.jdbc.odbc.JdbcOdbcObject#CharsToBytes() calls
       "nextCharIndex()" method instead of
            ^^^^
       "nextByteIndex()" method of sun.io.CharToByteConverter class.
            ^^^^

      You should correct CharsToBytes() method like follow.

      ========================================
      //concat converted array onto return array
      // byte[] tRetBytes=new byte[retBytes.length + toBytes.nextCharIndex()];
      byte[] tRetBytes=new byte[retBytes.length + toBytes.nextByteIndex()];
      System.arraycopy(retBytes, 0, tRetBytes, 0, retBytes.length);
      //System.arraycopy(outBuf, 0, tRetBytes, retBytes.length, toBytes.nextCharIndex());
      System.arraycopy(outBuf, 0, tRetBytes, retBytes.length, toBytes.nextByteIndex());
      retBytes=new byte [tRetBytes.length];
      System.arraycopy(tRetBytes, 0, retBytes, 0, tRetBytes.length);
      ========================================

      This is VERY IMPORTANT BUG for Japanese developer!!
      So please correct rapidly!!
      (Review ID: 96533)
      ======================================================================

      Name: krT82822 Date: 11/02/99


      java version "1.2"
      Classic VM (build JDK-1.2-V, native threads)

      Jdbc-odbc driver can't transefer Chinese char. query string, eg:
          ...
          String url = "jdbc:odbc:map263";
          try{
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              Connection c = DriverManager.getConnection(url, "sa", "");
              Statement stmt = c.createStatement();
              String sqlstr = "select id, roadname, class from road where roadname
      like '??????%'";
              ResultSet rs = stmt.executeQuery(sqlstr);
              if(rs != null)
              {
                  System.out.println(sqlstr + " Conneted.");
              }

              stmt.close();
              c.close();
          }catch(Exception e){
      e.printStackTrace();
         }

      When I run this code, it will be report:
      {{
      java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]
      Unclosed quote before the character string '??????'.
      }}
      When the Chinese string more than 1 char(One Char is ok).
      (Review ID: 97261)
      ======================================================================

            jellissunw Jon Ellis (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: