解决ADF+MySQL Table filter失效问题
来源:互联网 发布:软件行业人均销售额 编辑:程序博客网 时间:2024/05/16 07:13
Table filtering, aka Query by example, is a great feature of ADF tables. This feature provides filterboxes on top of a column(es).
and filters the data based on the values in the filterbox:
This works like a charm on an Oracle database, but when you use MySQL the filtering doesn’t work and actually doesn’t retrieve any data at all. As you can understand, this is not expected and definitely not wanted behaviour.
The first step in solving this behaviour was to enable logging (either via the weblogic diagnostic console or by adding -Djbo.debugoutput=console to the Java Options in the project properties Run configuration). In the log console we see that the SQL statement for this table collection / ViewObject now includes a where clause that includes the table filter value(s): ‘WHERE ( ( (EmployeesEo.FIRST_NAME LIKE ( :vc_temp_1 || ‘%’) ) ) )‘. This where clause with the % appended to the variable is automatically performed by the ADF framework.
As it turned out, this concatenation of the value with the % (:vc_temp || ‘%’) was the cause of our problem. This concatenation with a double pipe is a SQL92 standard. However with MySQL the concatenation is done with the concat function and not the double pipe. Thus this statement causes an exception somewhere in MySQL, and the result is that no data is returned.
The solution is actually quite easy because you can configure the ‘strictness’ of MySQL to the SQL standard via the SQL mode. In this case: SET sql_mode = ‘PIPES_AS_CONCAT’. This value can also be set in the my.cnf or my.ini files or provided at startup via the: –sql-mode=”PIPES_AS_CONCAT” option. Now the filtering works as expected.
按照上述方法操作,可解决此问题
——by Mu hongdi
阅读全文
0 0
- 解决ADF+MySQL Table filter失效问题
- Filter 失效问题
- ADF table列中下拉取值问题
- table宽度失效-table布局的问题
- 解决c3p0 mysql八小时连接失效问题
- 解决componentName失效问题
- 解决ADF quick query/query with table bug 12551764
- 解决ADF中记录锁的问题
- ADF中解决sequence断号问题
- 解决ADF中记录锁的问题
- MySQL事务处理失效问题
- MySQL连接失效问题
- spring security 自定义filter 会话失效问题
- Filter解决编码问题
- 如何清除adf table组件字段上面自带的filter过滤条件
- 如何解决MySql的Table is full问题
- 解决mysql出现"the table is full"的问题
- 解决mysql出现"the table is full"的问题
- scala学习笔记(四)流程控制
- scala学习笔记(五)集合操作
- scala学习笔记(六)Map和Tuple
- 解决ADF中记录锁的问题
- WebService学习第二天(2)
- 解决ADF+MySQL Table filter失效问题
- Hibernate注解使用方法总结
- Oracle SOA 开发运维经验总结
- weblogic启动脚本
- 温故知新 Java基础(一)
- PostgreSQL数据库从入门到精通
- 温故知新 Java基础(二)
- 关于长尾应用的一些思考
- 3D数学基础---矩阵旋转