我是用一个Java servlet这样引号的字符串没有正确结束异常
Connection con;
PreparedStatement ps,ps1;
ResultSet rs;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch (ClassNotFoundException e)
{
System.out.println("Drivers Not Found");
}
try{
con=DriverManager.getConnection("jdbc:odbc:SharedCryptography", "fyp", "fyp");
}catch(SQLException e1)
{
}
String query="UPDATE tbGroup SET GPassword='"+mypassword+"' where GName='"+GroupNamee+"' and OEmail='"+OwnerId+"'";
java.sql.Statement stmt = con.createStatement();
stmt.executeUpdate(query);
在Oracle DATABSE更新密码,但它给值java.sql.SQLException:[甲骨文] [ODBC] [奥拉] ORA- 01756:引用字符串没有正确结束
难道我做错了什么在里面请帮助
做一你的价值观中有单引号字符吗? – rgettman
@rgettman你在谈论什么价值? – user3445854
Thi当程序员没有正确地逃避查询参数时会发生什么。你应该真的使用准备好的语句 – BackSlash