The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Use two single quotation to avoid sql server error

Posted by Ashis Kumar Kar on May 15, 2000 at 12:44 PM

> I created a servlet application. Whenever the user enters any string with single quotes, it throwsa sql exception. How do I parse the the string to take care of the quotes.


Although I don't work on Java, the problem looks familiar to me. I suggest you replace any single quotation(') by two single quotation mark in your data while forming the query and then run the query, it should work.
Thanks,
Ashis






Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us