Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use apostraphe in select statement

 
ranga shreya
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There,
I am trying to login as different names(newport news,Kohl's,macy's).
With my query I am abel to get my data for "newport news" not for"macy's".
My Question is how to get data if I login as "macy's". What could be the select statement.
Give me some suggessions.
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose you need to escape that ' character. Use \\' to pass it in your query.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can use a PreparedStatement and these problems just... go away
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ranga,
Welcome to JavaRanch!

I agree with David that you should use Prepared Statements. The Sun tutorial walks you through the details.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic