Results 1 to 2 of 2

Thread: Needing Help!!

  1. #1
    kingjut06 is offline Member
    Join Date
    Jul 2007
    Posts
    1
    Rep Power
    0

    Default Needing Help!!

    Hello Everyone, I'm new to the forum so I would like to first say that its nice to virtually meet everyone.

    I'm having a problem with a program I'm making, I'm connecting my java application to a database that has numerous tables in it. Is there any way for the user to specify which table they would like to work with. For instance when the program starts it prompts the user to enter a table name, is there a way after the name is stored to use that with my sql commands, thus far I've been getting syntax errors because of it.

    Heres an example of the code that gives an error, monthStr has the table name stored in it but causes a syntax error.

    statement.executeUpdate("INSERT INTO" +monthStr+"VALUES ("+"'"+rsName+"'"+","+"'"+rsDate+"'"+","+"'"+rsInv Num+"'"+","+rsParts+","+rsLabor+","+rsWrecker+","+ rsTax+","+rsTotal+")");

    Thanks

    Jut

  2. #2
    Heather is offline Senior Member
    Join Date
    Jun 2007
    Posts
    164
    Rep Power
    7

Similar Threads

  1. Reading Char without needing to press enter
    By x0psci in forum New To Java
    Replies: 0
    Last Post: 11-23-2007, 04:28 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
  •