This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi dan,Welcome to ranch community....
There can be two reasons for the exception thrown by your code-
1.You are using any reserved keyword in your SQL query(As far I concerned,there is nothing like this),If there is any use double quotes arround that(" ").
2.You are using mis-spelled column names or less than expected column names in your query.
I don't know how you are running that SQL statement exactly from your Java code, but note the following. It is a bad idea to concatenate an SQL statement together with values, like you're doing:
What happens if lic_no contains a characters that make your SQL statement invalid (for example, a single quote character)? This code is also vulnerable to a simple and common security problem, SQL injection. To prevent these problems, always use a PreparedStatement, like this:
The PreparedStatement will take care of proper escaping if lic_no contains text that make the SQL statement invalid, which also prevents the SQL injection vulnerability.