• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Query

 
Makarand Parab
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a delete statement as stated below
String queryParent = "delete from dtree where name = '" + folderName.trim() + "'";

Now foldername can be "Abby's"

should i convert single quote to two single quote like "Abby''s" for query to work properly.

Let me know please asap.

Regards
Makarand Parab
 
Maximilian Xavier Stocker
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find the answer in the JDBC FAQ on this site

http://faq.javaranch.com/view?JdbcUsageQuestions

Third question:
How do I INSERT or UPDATE a text value with a ' in it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic