2
votes

My application running with this below configurations TOMCAT - 6.0.18 Database - Oracle 11g enterprise Edition(11.2.0.2.0) Java Version - jdk 1.6 JDBC Driver - OJDBC14.jar(Not sure about exact version)

I am getting Oracle-Character-set-178 error, when i am passing Oracle Array type value into Stored procedure from java. Find below error message.

java.sql.SQLException: Non supported character set: oracle-character-set-178

Below is the code i am executing

String query = "{call DBA.SP_XXXX(?,?,?)}"; 
con = this.getConnection();
con=((DelegatingConnection) con).getInnermostDelegate();
oracle.sql.ArrayDescriptor descrip =oracle.sql.ArrayDescriptor.createDescriptor("DBA.ARRAY_TABLE", con);            
oracle.sql.ARRAY oracArray = new oracle.sql.ARRAY(descrip, con, arrayValue);
cs = con.prepareCall(query);                
cs.setString(1,ID); 
cs.registerOutParameter(2, java.sql.Types.VARCHAR); 
cs.setObject(3,oracArray); 
cs.execute();   

Below are the characterset value my oracle returns

PARAMETER VALUE

NLS_CHARACTERSET WE8MSWIN1252 NLS_NCHAR_CHARACTERSET AL16UTF16

i am not sure with exact version of OJDBC14.jar is running in my current setup but when i tried replacing with latest OJDBC14 and getting below error java.lang.NoSuchMethodError: oracle.i18n.text.converter.CharacterConverterOGS.getInstance(I)Loracle/sql/converter/CharacterConverters;

Please suggest me what is the issue and solution

2
Why are you using the old ojdbc14.jar instead of a later version, like ojdbc6.jar? What else is in your classpath - which orai18n.jar are you picking up, for example? I think you just have a mismatch of versions.Alex Poole
Thanks Alex, when i replace latest ojdbc6.jar i am getting below error "java.lang.SecurityException: Sealing violation loading oracle.jdbc.internal.ObjectData : Package oracle.jdbc.internal is sealed"Vic
sorry i forgot to mention, latest orai18n.jar which supports oracle 11g also added into classpathVic

2 Answers

2
votes

Resolved my issue with following solution: replaced ojdbc14.jar with exact versions of ojdbc6.jar & orai18n.jar which supports my oracle 11.2.0.2.

0
votes

Had the same error!

I was using spring, so if you did as well, it will guide you inside the error with something like add the orai18n.jar to classpath and thats all you should do, but if you did and error was insisting to show up, mkdir a lib dir to your root and fill it with oracle jars of your chosen version and do use the maven plugin to include jars in your compile.

any jar should be provided by compile scope so you dont get production errors.