java使用什么方法来转义所有可转义字符
我的数据库有问题:我需要为任何类型的转义字符(如^{
我现在正在用这个
String selectSQL2 = "SELECT * FROM "+postid+" WHERE name="+"'"+name+"'";
ResultSet tableExistance = null;
tableExistance = conn.prepareStatement(selectSQL2).executeQuery(selectSQL2);
你可以在下面搜索框中键入要查询的问题!
我的数据库有问题:我需要为任何类型的转义字符(如^{
我现在正在用这个
String selectSQL2 = "SELECT * FROM "+postid+" WHERE name="+"'"+name+"'";
ResultSet tableExistance = null;
tableExistance = conn.prepareStatement(selectSQL2).executeQuery(selectSQL2);
# 1 楼答案
PreparedStatement
将处理字符转义(保留字转义除外),但您需要使用正确版本的^{