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

UTF-16 returned as UTF-8 from SQL Server for type ntext field (nvarchar OK)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0, 1.4.0
    • core-libs
    • beta
    • x86
    • windows_nt, windows_2000



      Name: krC82822 Date: 10/14/2000


      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      When accessing a cell of type "ntext" (UNICODE UTF-16) in SQL Server 7.0 using
      the JDBC ODBC bridge the returned String (using getString(n)) is of type UTF-8,
      resulting in every other character being an ASCII 0. This is not a problem
      with "nvarchar" which returns correctly.

      Entry into database: repository
      Returned bytes (spaces are actually ASCII 0): r e p o s i t o r y
      Returned String: 7200650070006F007300690074006F0072007900
      (Review ID: 110710)
      ======================================================================

      Name: krC82822 Date: 12/15/2000


      C:\>java -version
      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      When i call ResultSet.getObject() on a nvarchar column I get null.
      If i use a varchar column then i get the right data.

      It seems to be a bug in the JDBC/ODBC bridge.
      (Review ID: 113784)
      ======================================================================

            jbrucesunw Jonathan Bruce (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: