The code is
Node codeiso3= node.selectSingleNode("isoAlpha3");
Node capital= node.selectSingleNode("capital");
System.out.println(codeiso3.getText() + capital.getText());
String tempstring="UPDATE country_details SET capital = ? WHERE codeISO3 = ? ;";
System.out.println(tempstring);
z=conn.prepareStatement(tempstring);
String x = "\""+capital.getText()+"\"";
String y = "\""+codeiso3.getText()+"\"";
System.out.println(x);
System.out.println(y);
z.setString(1,x);
z.setString(2,y);
z.executeUpdate (tempstring);
The Error is
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorEx ception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? WHERE codeISO3 = ?'
Im getting the nodes correctly.There is error in including the string which i got within double quotes.I have tried various methods to include double quotes but in vain.Can anybody say how to do this?
Thankyou in advance!!!


LinkBack URL
About LinkBacks
Reply With Quote