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
Marshal
Posts: 35274
384
Eclipse IDE Java VI Editor
 
    Bookmark Topic Watch Topic
  • New Topic