标题: 数据库开发中,apache dbutils查询时出错是怎么回事? [打印本页] 作者: 亮 时间: 2013-7-16 11:10 标题: 数据库开发中,apache dbutils查询时出错是怎么回事? 最近在开发一个东西,数据库操作层用的是apachedbutils,结果今天遇到一个恶心的问题,就是我的SQL是这样的:select top 9 * fromENLesson where (name_cn like ? or name_en like ?) and id not in(select top 0 idfrom ENLesson where name_cn like ? or name_en like ?);然后程序是queryRunner.query(sql,newBeanListHandler<Lesson>(Lesson.class),&quot;%&quot; + key +&quot;%&quot;, &quot;%&quot; + key + &quot;%&quot;, &quot;%&quot; + key +&quot;%&quot;, &quot;%&quot; + key + &quot;%&quot;);程序一直报错:java.sql.SQLException:com.microsoft.sqlserver.jdbc.SQLServerException: &#39;,&#39; 附近有语法错误作者: 淡写轻描 时间: 2013-7-16 11:19
是sqljdbc4.jar的问题,在dbutils里面有这样一个方法stm.getParameterMetaData();执行这个方法的时候出错了,也就是说是sql server 驱动的问题