File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes Getting a SQL  Exception ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Getting a SQL  Exception ?" Watch "Getting a SQL  Exception ?" New topic

Getting a SQL Exception ?

lakmal padmakumara
Ranch Hand

Joined: Aug 08, 2009
Posts: 47

Hey Friends , I'm getting an error which is mentioned below when i run my programme !!

I know something wrong with my sql query .But Cannot figure it out !!!I have attached my sql database also .It does not contain any data .Only a Table .I have been checking this for nearly 7 hours using tutorials and other internet stuff.If you can please give me a help !!

My SQL Db is here

[Bsc in Computer Science and Engineering] [SCJP 80%][BCS certificate level]
Vijitha Kumara

Joined: Mar 24, 2008
Posts: 3817

As the exception says error is in your SQL:

After the "VALUES" clause you should have only one (opening) round bracket and one at the end (closing round bracket). It should not have any in between.

[How to ask questions] [Twitter]
lakmal padmakumara
Ranch Hand

Joined: Aug 08, 2009
Posts: 47
Hey Friends , I found it !!! From Java Ranch ,

The insert into code should be changed as

I agree. Here's the link:
subject: Getting a SQL Exception ?
Similar Threads
connecting to mysql, with java, on a mac
com.mysql.jdbc.exceptions.jdbc4.communicationsexception communications link failure
unable to connect to MS SQL server 2000
developing jsp page using cewolf
Passing ResultSet to JSP