Apostrophes And Parenthesis in the string

Hi Everyone.

How do you guys handle apostrophes and parenthesis in java?

I have a solution where the client wants to put apostrophes and parenthesis in the database as part of their strings. ie O'reily (also known as dude)

Now these apostrophes and parenthesis come from the database into the java program -- will it break my javascript strings manipulation? If so how can i treat it before it breaks the string

I know for a fact it breaks my javascript.

For example, I have a javascript method that is populated with variables that come from the database.

onchange="return DoThisFunction("<%=rs.getString("whatever")%>","<%=rs.getString("whoever")%>");"

thanks to parenthesis and apostrophes I get javascript alert errors can someone please enlightenme as to how i can fix this problem

Sincerely and Gratefully Yours,

Stephen A. Sutherland

[936 byte] By [stephensutherland] at [2007-9-26 1:14:03]
# 1
do you guys have a very simple method that you use to treat a string for apostrophes when it comes from the database ? or when the user enters a value with an apostrophe or parenthesis or anything else sincerelystephen
stephensutherland at 2007-6-29 0:12:16 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
You sound pretty confused dude. This is a Java forum, not a JavaScript forum.The apostrophes and parenthesis will not interfere with your Java variables, since the Java code is compiled and not based on simple string-substitution. The situation for parens is identical.
rloffelm at 2007-6-29 0:12:16 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...