This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes enter special characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "enter special characters" Watch "enter special characters" New topic
Author

enter special characters

apurv suthar
Ranch Hand

Joined: Feb 05, 2012
Posts: 35
When I use query- "INSERT INTO tab_name VALUES(param1,param2)" and passes email as parameter it shows syntax error at char "@"... why? I know that this can be solved by using PreparedStatement... but if I wants to use same query..how to do it?
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 2238
    
  23



No more Blub for me, thank you, Vicar.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

chris webster wrote:


oh you think he had missed the quotes and it was trying to use them as column names, ahhh that makes sense
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19747
    
  10

Wendy Gibbons wrote:oh you think he had missed the quotes and it was trying to use them as column names


Yeah, this commonly happens when people don't use PreparedStatement and try to build their SQL via string concatenation. Which is why you should always use PreparedStatement unless there's an extremely good reason why you can't.
apurv suthar
Ranch Hand

Joined: Feb 05, 2012
Posts: 35
Oh yah..I got it...sorry for my stupidity...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: enter special characters
 
jQuery in Action, 3rd edition