select job_id,job_name from a_job where (job_id in
(select job_id from a_question a1,c_question_job b1,a_project c1 where
a1.ques_id = b1.ques_id and b1.ques_type='2' and a1.proj_id = c1.proj_id and c1.proj_id =?)
or job_id in
(select job_id from a_req a2,c_req_job b2,a_project c2 where
a2.req_id = b2.req_id and b2.req_type='2' and a2.proj_id = c2.proj_id and c2.proj_id =?) or job_id in
(select job_id from a_question_d a3,c_question_job b3,a_project c3 where
a3.ques_id = b3.ques_id and b3.ques_type='1' and a3.proj_id = c3.proj_id and c3.proj_id =?) or job_id in
(select job_id from a_req_d a4,c_req_job b4,a_project c4 where
a4.req_id = b4.req_id and b4.req_type='1' and a4.proj_id = c4.proj_id and c4.proj_id =?)) and job_executor=?
使用PreparedStatement语句执行上面的sql,在tomcat下使用tomcat的连接池是正确没有问题的,但到了Weblogic里,换成Weblogic的连接池就不行了,查询出来的结果有问题,至于有什么规律没仔细研究,也没这个必要,到最后只能通过拼sql字符串的方式代替。