Inserting UTF-8 characters into database via BPEL process - oracle

We have a BPEL process that is taking characters (e.g. Chinese) and attempts to insert them into an NVARCHAR column. The XML payload looks correct throughout the various stages (and we see the encoding is UTF-8) but when it comes to the actual INSERT we are seeing incorrect characters. Our theory is that the DB Adapter could be the problem but we do not know for sure.
Is there a way to examine the version and config of the DB Adapter, to see if it can handle UTF-8 and Unicode? We have successfully inserted Chinese and Hewbrew characters into the database using TOAD, Java servlets, etc. so the database itself is configured. It is Oracle version 9.2.0.8.0.
It may be that the fault is elsewhere than the DB Adapter so we are trying to eliminate things. Would it be worth trying to look at the HTTP header to check the encoding here?
Thanks

We got to the bottom of this in the end. In a WSDL file (as part of the database connection details) we specified the defaultNChar=true property as an attribute and this was passed on to the database driver.

Related

JDBC with Non-Unicode database, how to specify handling of unsupported characters?

I have a Java application that works with Unicode and a database (Oracle, MSSQL, DB2, MySQL) that is in an 8-bit non-Unicode codepage (for example IBM1141). Migrating database to Unicode is not an option.
Is there any way to specify the behavior (replace/error/warn) of the JDBC driver, when the application passes a unicode character, which cannot be encoded in the database encoding?
The JDBC specification has nothing to say on the topic of encoding, so it is up to the implementation to handle this.
Since Java itself uses UTF-16 internally, every JDBC driver that is worth its salt will automatically convert between the database encoding and UTF-16.
The behaviour of a JDBC driver when it encounters characters that it cannot convert is implementation specific and will depend on the “philosophy” of the database system.
The two JDBC drivers I know well behave differently:
Oracle JDBC will silently replace characters that cannot be converted with a replacement character. There is no way to get the Oracle JDBC driver or the Oracle database to throw an error.
PostgreSQL JDBC will always report an error if a character cannot be converted. There is no way to get PostgreSQL to silently modify the character or store an invalid character.
This is normally not an issue when you read data from the database, because everything can be converted to UTF-16, but it will be a problem when writing to the database. You'll have to sanitize the data yourself before writing them to the database.

Oracle 11g and .NET ODP character set conversion

We have Oracle 11g database with EE8ISO8859P2 character set. This character set can’t be changed, i.e. it must stay as it is.
However the data that will be inserted and read from the database will be from another character set: CL8MSWIN1251.
We are using .NET and ODP. One possible approach is manual transliteration in the .NET application itself.
Is the following scenario with Oracle 11g, .NET and ODP feasible?
Data is stored on the server into database with EE8ISO8859P2 character set encoding.
ADO.NET ODP driver connects to the database and retrieves the character data as opaque bytes which are further decoded in the .NET client by using the mapping: CL8MSWIN1251=>CLR Unicode.
We have tried with NLS_LANG environment variable but that did not solve the problem.
Any suggestions?
I assume you mean ODP instead of ODC.
I don't think your proposal is a good idea. Of course, it is always possible to "cheat" the database character inside your .NET application. But imagine a DBA has to analyze an issue on the database. Usually he will use a tool like SQL*Plus, SQL Developer, or similar. Or what happens when another tool access the database, e.g. for reporting purpose. All these topics will not work.
An Oracle database actually has two character sets, the "normal" one the the "national" one. Perhaps you can use the second characters set by using NVARCHAR or NCHAR datatypes.

Oracle encoding problems

There is aan Oracle database with regional encoding for Kazakh language. There is also a client, but it uses UTF encoding.
When i update db field in Kazakh through pl/sql developer or call update proc in web application, these special characters becomes '?'.
But if i locate ora18n java file in oracle sql developer folder and update field in Kazakh, everithing works well.
How can solve my problem? If you need any db or clinet conf, u are welcome!

problems in inserting spanish words in oracle db

Is there a way to insert spanish words into the Oracle table - like 'España'.
When I try to insert it, it either takes the ASCII counterpart of it or replaces the 'ñ' with a '?'.
Has anyone done this before or knows a work around for it?
I found something while googling they told we have to mention spanish character set in init.ora file. I don't know how to do this and also setting nls_settings for client. I am using toad to connect to server which is located in UK.
Please help me in solving this problem.
First, you should check if the database was created with a character set that includes the Spanish characters that you want inserted. For versions of Oracle starting with 9i the wizards by default create the database using Unicode, so it shouldn't be a problem. But if the database wasn't created by you, this should be the first thing to check with the DBA that created it.
Which version of the Oracle server are you connecting to?
Which version of the Oracle client are you using? Which kind of Oracle client (OCI, JDBC, .NET)?
If the database was properly created it can be a problem related to the client platform.
And this is not simple to diagnose without information about the client OS, database client libraries that you are using and their configurations related to Natural Language Support.
So, I will point you to an Oracle FAQ related to this issue. It is a lot of material to read but it worths your time.
http://www.oracle.com/technetwork/database/globalization/nls-lang-099431.html

loading data from a flat file to table using informatica, having both english and foreign language characters like chinese

I am loading data from a flat file to table using informatica, the file has both english and foreign language characters like Chinese, and others. The foreign language characters are not getting displayed properly after loading. How can this problem be solved?
I could try to solve it by using UTF-16 encoding, but earlier I was using UTF-8.
Start with the Source in designer. Are you able to see the data correctly in the source qualifier preview? If not, you might want to set ff source definition encoding to UTF-8.
the Integration service should be running in Unicode mode and not ASCII mode. You can check this from the Integration service properties in Admin Console.
The target should be UTF-8 encoding.
Check the relational connection ( if the target is a database) encoding in workflow manager to ensure it is UTF-8
If the problem persists, write the output to a utf-8 flatfile and check if the data is loading properly. If yes, then the issue is with writing to the database.
Check the database settings like NLS_LANG, NLS_CHARACTERSET (for oracle) etc.
Sadagopan
You need to find out the encoding for the Integration Service that runs the workflow of the loading. Informatica supports three different encoding for this, utf-8, ascii and windows-1252, you need to make sure yours is utf-8. You also need to tell the source qualifier for the workflow to use the right encoding to read the file (could be utf-8 or utf-16). And finally you must make sure your database tables are using an encoding that supports chinese.

Resources