This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes issue in CallableStatement.execute() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "issue in CallableStatement.execute()" Watch "issue in CallableStatement.execute()" New topic
Author

issue in CallableStatement.execute()

Manish Shinde
Ranch Hand

Joined: Mar 30, 2011
Posts: 39
I have some serious doubts in CallableStatement.execute().

As per the documentation execute() method of CallableStatement will return true if very first result coming back from procdure
is java.lang.resultset.So if the execute() caused an update first, and then fired a query, then execute() will return false.

But in my procedure i m having two result set i.e two select queries and when i do CallableStatement.execute() from the program
i am getting false in return all the time

question :
1)Why CallableStatement.execute() method reurning false.
2)Also CallableStatement.getResultSet() method returns null.
Following is the porcedure and java code.

i m using oracle 8i and procedure is working fine on editor.
Also the java program is working fine.
but i want process the results from procedure by using resultset.


PROCDEURE :

create or replace procedure procedure_1(v_name OUT MEMPLOYEE.ENAME%type,v_dname OUT MDEPT.DNAME%type)
is
begin
select ENAME into v_name
from MEMPLOYEE
where EMPID=1000;
select DNAME into v_dname
from MDEPT
where deptno=500;
dbms_output.put_line(v_name ||' '|| v_dname);
end;
/

CODE :


Thanks in advance
Manish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: issue in CallableStatement.execute()
 
Similar Threads
Problem with IN clause
executeQuery( ) method
How to Execute Stored Procedure?
calling oracle procedures in java
Error :java.sql.SQLException: Invalid column index