IBM Support

JR27844: data should not be prefixed by the XML decalaration for Java application

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • From manual.
    http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?top
    ic=/com.ibm.db2.udb.apdv.embed.doc/doc/c0022545.htm
    
    For Java or .NET applications, no encoding declaration is added,
    unless you cast the data as the com.ibm.db2.jcc.DB2Xml type, and
    use a getDB2Xmlxxx method to retrieve the data. The declaration
    that is added depends on the getDB2Xmlxxx that you use.
    
    However Legacy JDBC Type 2 Driver is adding Byte Order Mark(BOM)
    and XML declaration.
    
    
    Here is result of output.
    
    ResultSet rset = stmt.executeQuery( "select info from customer
    where cid=1002 " );
    info = rset.getString( "info" );
    System.out.println(info);
    
    ?<?xml version="1.0" encoding="UTF-16" ?><customerinfo...
    First ? is BOM(0x0XFEFF)
    
    The following output is expected.
    <customerinfo...
    

Local fix

  • Add db2cli.ini in COMMON section as below
    [COMMON]
    XMLDeclaration=0
    

Problem summary

  • From manual.
    http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?top
    ic=/com.ibm.db2.udb.apdv.embed.doc/doc/c0022545.htm
    
    For Java or .NET applications, no encoding declaration is added,
    unless you cast the data as the com.ibm.db2.jcc.DB2Xml type, and
    use a getDB2Xmlxxx method to retrieve the data. The declaration
    that is added depends on the getDB2Xmlxxx that you use.
    
    However Legacy JDBC Type 2 Driver is adding Byte Order Mark(BOM)
    and XML declaration.
    
    
    Here is result of output.
    
    ResultSet rset = stmt.executeQuery( "select info from customer
    where cid=1002 " );
    info = rset.getString( "info" );
    System.out.println(info);
    
    ?<?xml version="1.0" encoding="UTF-16" ?><customerinfo...
    First ? is BOM(0x0XFEFF)
    
    The following output is expected.
    <customerinfo...
    

Problem conclusion

  • Problem was first fixed in DB2 UDB Version 9.1 FixPack 5
    

Temporary fix

Comments

APAR Information

  • APAR number

    JR27844

  • Reported component name

    DB2 UDB ESE WIN

  • Reported component ID

    5765F4101

  • Reported release

    910

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2007-11-30

  • Closed date

    2008-06-24

  • Last modified date

    2008-06-24

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    JR27906

Fix information

  • Fixed component name

    DB2 UDB ESE WIN

  • Fixed component ID

    5765F4101

Applicable component levels

  • R910 PSN

       UP

[{"Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"910"}]

Document Information

Modified date:
07 October 2021