Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Rep Power

    Default sql in jsp error

    String sql = ("SELECT sid,serial# FROM v$session WHERE USERNAME="+username+"AND MACHINE="+machine+";") ;

    I want to get sid and serial no from username and machine using v$session for enabling trace using jsp
    For this statement i'm getting error:
    Error: java.sql.SQLException: ORA-00933: SQL command not properly ended
    Pls help me out! I'm new to all this so put it in layman terms

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: sql in jsp error

    Use a PreparedStatement and bind (using getXXXX() methods) those variables in.
    You shouldn't concatenate your SQL together like that except in (usually rare) circumstances.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. java out of memory error-heap space error
    By elsanthosh in forum NetBeans
    Replies: 4
    Last Post: 06-15-2010, 09:31 AM
  2. Replies: 1
    Last Post: 03-10-2010, 01:53 PM
  3. Replies: 1
    Last Post: 12-05-2009, 07:28 AM
  4. Replies: 1
    Last Post: 10-26-2009, 04:38 PM
  5. Replies: 3
    Last Post: 01-23-2009, 08:53 AM

Posting Permissions

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