I mean for something like this

HTML Code:
<title> A sample </title>

<center><h1><B> A header </B></h1></center><br/>
<h:form id="form1">

<B> Input some text here: </B> <h:inputText id="tf" value="#{someBean.someVariable}"></h:inputText><br/>
<h:commandButton action="#{someBean.persist()}" value="Submit" type="submit"></h:commandButton>


Now suppose that the user enters the name

"O'Connor" and it's using SQL to parse it into a database. How do you get it to not mess up or throw an error when it encounters the "' ' " in the input?

SQL is used with ' ' I've heard (and seen a little bit too).

Our instructor had expected us to figure it out sort of on our own, though I never could. (The class is over. No problem with telling me now.)

I was able to stop it from getting the error though I think I just told it to change all " ' " to " " "" .

However, people won't like that if that actually was a real database. So is there another way to do it?

Note: I think there was some kind of fancy xml tags and stuff you should need if you're going to use JSF but I can't recall what those were (I just copied and pasted them every time I needed them.)