Troubleshooting
Problem
You receive an error message when you call a stored procedure hosted on a Microsoft SQL Server 2005 database from a WebSphere Enterprise Bus V6.2 mediation using WebSphere Adapter for JDBC V6.2.
Symptom
You call a stored procedure hosted on a Microsoft SQL Server 2005 database from a
WebSphere Enterprise Service Bus V6.2 mediation using WebSphere Adapter for JDBC 6.2. The stored procedure takes a string argument with a serialized data object in XML format . An example is attached below:
<?xml version="1.0" encoding="UTF-8"?>
<p:EventData xsi:type="p:EventData" xmlns:xsi="http://www.w3.
org/2001/XMLSchema-instance" xmlns:p="http://www.timetrade.com/ws">
<eventDate>2009-08-06T22:12:19.951Z</eventDate>
:
:
: data omitted
:
:
</p:EventData>
You receive the following error message:
ResourceException thrown in J2CMethodBindingImpl.invoke() javax.
resource.ResourceException: [IBM][SQLServer JDBC Driver][SQLServer]XML
parsing: line 1, character 38, unable to switch the encoding, error
code: 9402
If you manually change the UTF encoding from "UTF-8" to "UTF-16" in the serialized XML, the stored procedure works.
If you use the SQL server tools to call the same stored procedure, it fails with UTF-16 and only accepts UTF-8.
Cause
This issue is caused by the Microsoft SQL Server database storing UTF-8 data, and is not a JDBC Adapter related issue.
Resolving The Problem
The behavior is specific to the Microsoft SQL Server database server, and is not a JDBC Adapter problem.
To resolve the issue, refer to the following document from Microsoft:
Description of storing UTF-8 data in SQL Server: http://support.microsoft.com/kb/232580
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21398797