Reputation: 81
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
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
Upvotes: 4
Views: 22781
Reputation: 367
<!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc8 -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>23.2.0.0</version>
</dependency>
<!--https://mvnrepository.com/artifact/com.oracle.database.nls/orai18n -->
<dependency>
<groupId>com.oracle.database.nls</groupId>
<artifactId>orai18n</artifactId>
<version>23.2.0.0</version>
</dependency>
Upvotes: 2
Reputation: 71
add this dependency:
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>orai18n</artifactId>
<version>19.3.0.0</version>
</dependency>
Upvotes: 6
Reputation: 1839
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.
Upvotes: 0
Reputation: 81
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.
Upvotes: 3