[update request]problem with parameter value
Posted by: serge nzudie
Date: July 08, 2012 05:29AM

Hi all,
I would like to query for insertion into a MySQL database via java.
but when the value of this.name is sommething like <F'lick>, I get an error. How can I avoid?

My code :

try{
Statement stm= con.createStatement();

stm.executeUpdate("INSERT INTO tblclients(firstname) VALUES ('" + this.name + "');'");

}catch (Exception e) {
System.out.println(e.getMessage());
}

thanks,

Options: ReplyQuote


Subject
Written By
Posted
[update request]problem with parameter value
July 08, 2012 05:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.