File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Problem with callable statement!!!!!!!!!!!!!!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Problem with callable statement!!!!!!!!!!!!!!!!" Watch "Problem with callable statement!!!!!!!!!!!!!!!!" New topic

Problem with callable statement!!!!!!!!!!!!!!!!

Jyothsna Sri Y
Ranch Hand

Joined: Sep 25, 2003
Posts: 35
Hi everyone,
I encounter a problem with the registerOutParameter() method while using Callable Statement.
I'm using these procedures to write and retrieve image files to and from a database. the code is as follows:

static String sqlOut=
" begin"+
" insert into pic_store(description,picture)"+
" values(?,empty_blob())"+
" return picture into ?;"+
" end;";
/*code to connect to the database*/
CallableStatement stmt=con.prepareCall(sqlOut);
System.out.println("going to set string "+stmt);
System.out.println("going to set string "+stmt);
System.out.println("going to register parameters");


System.out.println("going to execute "+stmt);

The error I'm encountering is:
going to register parameters
at sun.jdbc.odbc.JdbcOdbcCallableStatement.registerOutParameter(Unknown
at sun.jdbc.odbc.JdbcOdbcCallableStatement.registerOutParameter(Unknown
at PicLoader.write(
at PicLoader.main(
Can someone tell me where the problem lies?
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
use oracle.jdbc.driver.OracleDriver not odbc!
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Problem with callable statement!!!!!!!!!!!!!!!!