This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 3816

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
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
connecting to mysql, with java, on a mac