It's not a secret anymore!
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
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!
I agree. Here's the link:
subject: Problem with callable statement!!!!!!!!!!!!!!!!
It's not a secret anymore!