将Play框架2与DB2(AS400或LUW)一起使用

时间:2013-05-24 12:55:47

标签: playframework db2 playframework-2.0 db2-400

有没有人成功地将Play框架与IBM DB2 for AS00或DB2LUW一起使用。我试图针对AS400上的DB2数据库运行Zentasks示例,但是我遇到了这个例外:

Internal server error, for (GET) [/projects/1/tasks]

play.api.Application$$anon$1: Execution exception[[PersistenceException: Query threw SQLException:Token <END-OF-STATEMENT> not valid. Valid tokens: AS CL IN LOG OUT DATA COLLECT.                                                                                
Bind values:[null]                                                                                                               
Query was:                                                                                                                       
select count(*) from ( select distinct t0.id c0                                                                                  
from project t0                                                                                                                  
join project_account u1z_ on u1z_.project_id = t0.id                                                                             
join account u1 on u1.email = u1z_.account_email                                                                                 
where u1.email = ?  and t0.id = ? )

Internal server error, for (GET) [/projects/1/tasks] play.api.Application$$anon$1: Execution exception[[PersistenceException: Query threw SQLException:Token <END-OF-STATEMENT> not valid. Valid tokens: AS CL IN LOG OUT DATA COLLECT. Bind values:[null] Query was: select count(*) from ( select distinct t0.id c0 from project t0 join project_account u1z_ on u1z_.project_id = t0.id join account u1 on u1.email = u1z_.account_email where u1.email = ? and t0.id = ? )

上述查询在DB2语法中无效。一个有效的就像是;

with qry as ( select distinct t0.id c0                                                                                  
from project t0                                                                                                                  
join project_account u1z_ on u1z_.project_id = t0.id                                                                             
join account u1 on u1.email = u1z_.account_email)  
select count(*) from qry where u1.email = ?  and t0.id = ?      

0 个答案:

没有答案