MyBatis的SQL语句的两种取值方式

第一种就是用$符号进行取值 执行SQL:select * from user where name = ${Name} 参数:Name传入值为:zhangsan 解析后执行的SQL:Select * from user where name = zhangsan字符串 这种方式容易有SQL注入,就至关因而你直接用JDBC的时候去拼接一个字符串出来。select 第二种就是用#符号进行取值 执行SQ
相关文章
相关标签/搜索