Bookmark Topic Watch Topic
  • New Topic

\' postrophy problem

 
Mark Antone
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello every body i have problem in SQl syntax :
the problem is i have JSP page accepted parameters and put them in strings like this:

String Question = request.getParamerter("QuestionsD");

and this question will have any carachter also special characters like this

What is # your age $?

thsi will intered to database succefully but when my question has ' like

what's your age? is face error in sql syntax:

statement s = null;
Resultset st = s.executQuery("insert into tablename(questionDetail) values"+"('"+Question+"')");

the error is
SQL syntax in 's your and bla blah...
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36027
432
Eclipse IDE Java VI Editor
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!