Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2011
    Location
    India,Tamil Nadu
    Posts
    32
    Rep Power
    0

    Smile java.sql.SQLException:

    Java Code:
    String g="FUP1UN";
    sql[1]=" select Confidence from cpm1 where Combinedrule= "+g;
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'FUP1UN'
    i am Sql using 2000.
    But,

    Java Code:
    sql[1]=" select Confidence from cpm1 where Combinedrule='FUP1UN'";
    This code executed successfully.
    Last edited by nandhinianand; 09-27-2011 at 12:19 PM.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default Re: java.sql.SQLException:

    Note the difference between the two Strings...in particular the single quotes. Avoid this necessity by using PreparedStatement.

  3. #3
    Join Date
    Jul 2011
    Location
    India,Tamil Nadu
    Posts
    32
    Rep Power
    0

    Default Re: java.sql.SQLException:

    Respected senior member,
    Thank you .

Similar Threads

  1. java.sql.sqlException
    By harsimran05 in forum JDBC
    Replies: 1
    Last Post: 09-06-2011, 12:14 PM
  2. java.sql.SQLException: Invalid column name
    By agangaia in forum JDBC
    Replies: 7
    Last Post: 04-14-2011, 01:06 PM
  3. Replies: 0
    Last Post: 01-21-2011, 12:43 PM
  4. Replies: 2
    Last Post: 06-07-2010, 08:45 AM
  5. Unreported exception java.sql.SQLException
    By javamula in forum AWT / Swing
    Replies: 4
    Last Post: 09-29-2009, 02:32 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
  •