friends,
i'm facing a problem in inserting data in a database where the data contains an apostrophe(').
first i'm extracting some data from a Table(say A)and then after some modification I'm inserting it to another table say(site_table).
the problem arises when i'm trying to insert into site-table a variable whose contents include an apostrophe
after the resultset(rs) of query to extract data from table A i'm giving the following
to insert into site-table
String sname=rs.getString("Name"
String id=rs.getString("School_shortname"
String path="Statement st1=conn.createStatement();
st1.executeUpdate("Insert into site_table(keyword,web_location)values ('"+sname+"','"+path +"')"
st1.close()
I'm getting the following error [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''Children's Valley School'.
it is not inserting the above data as it contains an apostrophe.
how do i handle it.Can anybody help me
thanx
i'm facing a problem in inserting data in a database where the data contains an apostrophe(').
first i'm extracting some data from a Table(say A)and then after some modification I'm inserting it to another table say(site_table).
the problem arises when i'm trying to insert into site-table a variable whose contents include an apostrophe
after the resultset(rs) of query to extract data from table A i'm giving the following
to insert into site-table
String sname=rs.getString("Name"
String id=rs.getString("School_shortname"
String path="Statement st1=conn.createStatement();
st1.executeUpdate("Insert into site_table(keyword,web_location)values ('"+sname+"','"+path +"')"
st1.close()
I'm getting the following error [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''Children's Valley School'.
it is not inserting the above data as it contains an apostrophe.
how do i handle it.Can anybody help me
thanx