用queryRunner.update(connection, sql, args);向数据库插入一条数据出错,报java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerException: 关键字 'WHERE' 附近有语法错误。求教大神是什么原因,用junit test case测试能连通数据库,数据库是sql server 2008 ,sql语句是insert into customers(id,name,addres,phone)values('?','?','?','?')
使用方法 update(sql,customer.getId(),customer.getName(),customer.getAddress(),customer.getPhone());传入参数
public void update(String sql,Object ...args) {
Connection connection = null;
try {
connection = JDBCUtils.getConnection();
queryRunner.update(connection, sql, args);
} catch (Exception e) {
e.printStackTrace();
} finally {
JDBCUtils.releaseConnection(connection);
}
}