Results 1 to 4 of 4
  1. #1
    jyotigupta6 is offline Member
    Join Date
    Oct 2008
    Posts
    11
    Rep Power
    0

    Default SQL Exception from java program

    Hi All

    I am trying to execute stored procedure from java program and getting this error. Please suggest me on this.
    java.sql.SQLException: ORA-20000: ERROR -911: ORA-00911: invalid character

    Regards
    Jyoti

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    10

    Default

    You have an error in your sql. It might behoove you to post the code. However, I can tell you without even looking at the code, that if you are cobbling together an SQL string to use in a Statement object (i.e
    Java Code:
    String sql = "Select * from bogus where bs = '" + someVar + "'";
    ) then that is at least half of your problem.

    Use PreparedStatement (and use it properly).

  3. #3
    jyotigupta6 is offline Member
    Join Date
    Oct 2008
    Posts
    11
    Rep Power
    0

    Default Re:SQL Exception

    Hi

    The code goes here -

    objStatement = objConnection.createStatement();
    objResultset = objStatement.executeQuery("select ORIGINAL_CONTENT from pdrepadm.CABI where DOC_ID=1");
    while(objResultset.next()){
    Clob clob = objResultset.getClob(1);
    BufferedReader reader = new BufferedReader(new InputStreamReader ( clob.getAsciiStream() ) );
    String line = null;
    while (( line = reader.readLine()) != null)
    {
    System.out.println(line);
    }
    reader.close();
    }

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    10

    Default

    From ORA-00900 to ORA-01499

    ORA-00911 invalid character

    Cause: Special characters are valid only in certain places. If special characters other than $, _, and # are used in a name and the name is not enclosed in double quotation marks ("), this message will be issued. One exception to this rule is for database names; in this case, double quotes are stripped out and ignored.

    Action: Remove the invalid character from the statement or enclose the object name in double quotation marks.
    So as far as I can see, that statement cannot cause that error. Are you sure that is the statement causing it.

Similar Threads

  1. Replies: 3
    Last Post: 04-07-2008, 05:56 PM
  2. Replies: 0
    Last Post: 04-04-2008, 02:40 PM
  3. Replies: 1
    Last Post: 03-08-2008, 07:41 PM
  4. Replies: 0
    Last Post: 10-04-2007, 09:33 PM
  5. Java mail api exception
    By oregon in forum New To Java
    Replies: 1
    Last Post: 08-05-2007, 06:03 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
  •