|
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
|