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 mysql select 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 "mysql select exception" Watch "mysql select exception" New topic

mysql select exception

srinus reddyy

Joined: Jul 04, 2007
Posts: 6
select BAR_fname,BAR_lname,BAR_empid,BAR_userid,BAR_date_of_regn
from boomerang_alumni_registration where BAR_status="current";

i am getting the below exception while executing the query
please let me know what's wrong with the query

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"curr' at line 2
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

use single quotes around strings in SQL, not double quotes
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3702

And a reminder use two single quotes (not the double quotes character) to include an actual single quote within the text of the query. Such as: SELECT * FROM widgets WHERE name = 'O''brian'

My Blog: Down Home Country Coding with Scott Selikoff
Consider Paul's rocket mass heater.
subject: mysql select exception
Similar Threads
Newbie's question for Hibernate+MySQL
Can't execute prepared statements using mySQL
what wrong with 1=1 ?
MySQL error
someone please help me out with this thing