• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

oracle.jdbc.driver.OracleCallableStatement is not public in OJDBC5.jar

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

In my application I am using ojdbc14.jar, but application is running on Java 1.5 (Batch) and Java 1.6 (web). I tried to migrate to ojdbc5.jar which is recommended for java 1.5 and Oracle 11g.

Here is the code which I am using

import oracle.jdbc.driver.OracleCallableStatement

cstmt = (OracleCallableStatement)conn.prepareCall("begin zzzzzzzzz(?,?,?,?,?,?); end;");
String[] pmsgs = (String[])(cstmt.getARRAY(6).getArray());

When I used ojdbc5.jar
import oracle.jdbc.driver.OracleCallableStatement was not visible as it is not public in the ojdbc5.jar. Instead when I tried
import oracle.jdbc.OracleCallableStatement and
String[] pmsgs = (String[])(cstmt.getArray(6));

it worked.

I have 2 questions.

1. Instead of import oracle.jdbc.driver.OracleCallableStatement can i use import oracle.jdbc.OracleCallableStatement in my code.
2. Or if the above statement is wrong which class can be used instead of import oracle.jdbc.driver.OracleCallableStatement in ojdbc5.jar

Thanks
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sharat,
As far as I am aware, oracle.jdbc.driver package is deprecated, hence you should not use it in your code.
I'm only going from memory and I haven't verified it, but I believe you can safely use method getArray of interface java.sql.CallableStatement instead of method getARRAY of interface oracle.jdbc.OracleCallableStatement.

Good Luck,
Avi.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To expand on this: Oracle has defined interfaces substituting the driver's classes in package oracle.jdbc. Interface oracle.jdbc.OracleCallableStatement still does have the method getARRAY. If you want to minimize changes to the code, you probably could use this interface instead of the implementation from the oracle.jdbc.driver package.
 
reply
    Bookmark Topic Watch Topic
  • New Topic