Results 1 to 3 of 3
Thread: Problem using CallableStatement
- 03-27-2010, 05:34 PM #1
Member
- Join Date
- Nov 2009
- Posts
- 8
- Rep Power
- 0
Problem using CallableStatement
Hello All
I'm using Oracle JDeveloper 11g on Windows XP.
Ive written a procedure that will write a line of text to a file.
When I run the sql script- It does what would be expected.
But when I try to execute via JDBC there is a problem.
Here is the code:
What happens is I get the following:Java Code:String sql = "{call write_log(?,?,?}"; System.out.println("logitem= "+logitem); try{ CallableStatement cs; if (resultSetType == ResultSet.TYPE_FORWARD_ONLY ) { cs = conn.prepareCall(sql); cs.setString(1,logitem); cs.setString(2,"C:\\WeDS\\WeDS\\src\\tmp"); cs.setString(3,"log.txt"); cs.execute(); } }catch(SQLException e){System.out.println("Darn! Something's wrong. "+e.getMessage());}
Where could this be coming from?XML Code:ORA-06550: line 1, column 28: PLS-00103: Encountered the symbol ";" when expecting one of the following: . ( ) , * @ % & | = - + < / > at in is mod remainder not range rem => .. <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between || indicator multiset member SUBMULTISET_ The symbol ")" was substituted for ";" to continue.
Why did the parser encounter a ';' ?
I'm asking because I was hoping that someone could shed some light on this.
-Regards J
- 03-27-2010, 05:55 PM #2
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
Look closely:
Happens to the best of us. Good luck!Java Code:String sql = "{call write_log(?,?,?}";
-Gary-
- 03-27-2010, 06:02 PM #3
Member
- Join Date
- Nov 2009
- Posts
- 8
- Rep Power
- 0
Similar Threads
-
CallableStatement example
By Java Tip in forum Java TipReplies: 0Last Post: 02-10-2008, 11:42 AM -
Using CallableStatement
By Java Tip in forum Java TipReplies: 0Last Post: 12-22-2007, 11:22 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks