Results 1 to 3 of 3
  1. #1
    jambon is offline Member
    Join Date
    Nov 2009
    Posts
    9
    Rep Power
    0

    Question 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:
    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());}
    What happens is I get the following:
    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.
    Where could this be coming from?
    Why did the parser encounter a ';' ?
    I'm asking because I was hoping that someone could shed some light on this.
    -Regards J

  2. #2
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Look closely:
    Java Code:
            String sql = "{call write_log(?,?,?}";
    Happens to the best of us. Good luck!

    -Gary-

  3. #3
    jambon is offline Member
    Join Date
    Nov 2009
    Posts
    9
    Rep Power
    0

    Red face

    How embarrassing.:o
    Thanks for drawing my attention to it!
    -Jambon

Similar Threads

  1. CallableStatement example
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-10-2008, 12:42 PM
  2. Using CallableStatement
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-22-2007, 12:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •