0

I am facing a problem which is independent of dbunit jar versions as I have tried with dbunit-2.0.jar, dbunit-2.2.1.jar, dbunit-2.4.9.jar, dbunit-2.2.3.jar and dbunit-2.3.0.jar and independent of Oracle Database version, as I tried on oracle11g and oracle12c.That the data which I try to insert through xml file into a column of datatype NCLOB for a table , it inserts junk characters which are of no use into the system for further processing.

But if I change the datatype of that column as CLOB it works perfectly fine while using dbunit for Oracle database insertion operation through XML. I am not sure what can be the reason for this behavior.

Our application is supporting NCLOB data insertion through Hibernate engine as well as direct SQL insert query for Oracle database but only insert junk characters while using dbunit setup for test Case execution.

enter image description here

We can't change datatype of that column from NCLOB to CLOB as our application supports multi-languages so we don't want to enforce any character set on this data. Please suggest, what can be done.

  • Hmmm...so if you use a plain CLOB (character LOB) it works fine, but if you use an NCLOB (Unicode character LOB) it doesn't. Perhaps the data you're putting into the NCLOB isn't stored in Unicode. Also of interest is the fact that the rows which are showing oriental-style (Japanese? Chinese?) characters have dates from 7-1/2 years ago. – Bob Jarvis - Слава Україні May 27 '16 at 11:11
  • @BobJarvis Yes, that's right using dbunit it is not storing NCLOB column data in correct formatting. These dates are old as it's my Test Data for test cases supplied through XML as "" – Harish Vashist May 28 '16 at 10:13
  • What's different between the data which worked (e.g. row 5) and the data which failed (e.g. row 6)? – Bob Jarvis - Слава Україні May 28 '16 at 12:51
  • @BobJarvis row5 data was inserted through Insert query execution on SQL Developer client i.e. insert into table_name(ID,DATEENTERED,CONTENTS1) values(969, sysdate, 'hello') while row6,7,8 data is inserted through dbunit jars mentioned in question above. – Harish Vashist May 28 '16 at 18:43

0 Answers0