Bookmark Topic Watch Topic
  • New Topic

\' postrophy problem  RSS feed

Mark Antone
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
Posts: 37398
Eclipse IDE Java VI Editor
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!