2017年4月18日

数据库增删改查因文本包含sql语句造成语法错误问题解决方法

摘要: 两种sql语句比较:第二种语句解决了因文本包含sql语句造成语法错误问题 1. String sql="insert into news(title,content,newsType,time,author,note)" + "values('"+news.getTitle()+"','"+news 阅读全文

posted @ 2017-04-18 17:38 FrankChia 阅读(226) 评论(0) 推荐(0)

数据库增删改查因文本包含sql语句造成语法错误问题解决方法

摘要: 两种sql语句比较:第二种语句解决了因文本包含sql语句造成语法错误问题 1. String sql="insert into news(title,content,newsType,time,author,note)" + "values('"+news.getTitle()+"','"+news 阅读全文

posted @ 2017-04-18 17:37 FrankChia 阅读(132) 评论(0) 推荐(0)

SQL 的转义字符是:'(单引号)

摘要: C++ 的转义字符是:/ SQL 的转义字符是:'(单引号) 例:select * from tbl where uyear='''06' 请注意其中红色背景的单引号,它即表示转义字符,如果我们省略,则整个语句会出错,转义字符不会输出,上例中 uyear 的实际条件值为 '06,而不是 ''06 为 阅读全文

posted @ 2017-04-18 16:46 FrankChia 阅读(689) 评论(0) 推荐(0)

导航