转自:http://www.68idc.cn/help/jiabenmake/qita/20140821125261.html 在mybatis的映射xml文件调用java类的方法: 1. SELECT * FROM EC_CORE_USER WHERE (user_name=#{userName} or mail =#{userName} or mobile_phone = '${@net.ytoec.framework.security.EncryptionDecryption@dSecre
String name =jtf.getText().trim(); String sql="select * from stu where stuname=' "+name+" ' "; '"+name+"'这样表示你数据库里的字段不是数字或者自动编号型的 "+name+"这样表示数字或者自动编号型 如果name是字符串常量,那么可以直接'name' 但是如果name是变量,那么就不能直接'name',因为直接这么使用