Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

escape character using prepared statement.

 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I m using a sybase database and type-4 driver.I have read that using prepared statement we don't need to use the escape character as prepareStatement put it internally but i do face a problem with single quote (')..though i m using prepared statement only.
Can anyone help me in this.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might be something the driver isn't doing correctly, but usually you don't have to worry about single quotes in PreparedStatements - they just get looked after.
Did you want to post a small snippet of code to show your population of data?
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David I have got the point where i was making error.
I just want to know can i set a "text" field by using setXXX() method of JDBC ( like setInt(),setLong() or setObject() ) ?we don't have any method like setText() or we have to use raw SQL string if we have datafield column as "text" in db ??
Thnx.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can't use setString() ?
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks its working now.I jus made things complicated.;-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic