如何在 JDO(Google App Engine)中转义查询参数?
例如,如果变量名可能包含不安全字符作为单引号 ('),我如何使下一个片段安全
PersistenceManager pm = ...;
String query = "select from Person where name='"+name+"'";
List<Shortened> shortened = (List<Shortened>) pm.newQuery(query).execute();
如何在 JDO(Google App Engine)中转义查询参数?
例如,如果变量名可能包含不安全字符作为单引号 ('),我如何使下一个片段安全
PersistenceManager pm = ...;
String query = "select from Person where name='"+name+"'";
List<Shortened> shortened = (List<Shortened>) pm.newQuery(query).execute();