简体   繁体   English

jpa调用过程db2

[英]jpa call procedure db2

Hey guys I have a procedure in DB2 and I'm trying call it using jpa hibernate, but I'm getting error. 大家好,我在DB2中有一个过程,我正在尝试使用jpa hibernate调用它,但是却遇到了错误。

Dependency maven is: 依赖专家是:

<dependency>
      <groupId>com.ibm.db2</groupId>
      <artifactId>db2jcc4</artifactId>
      <version>10.5</version>
</dependency>

Jpa pa

StoredProcedureQuery storedProcedure = entityManager.createStoredProcedureQuery("GL.GLMAPOUT");
storedProcedure.registerStoredProcedureParameter("O_ERROR", Integer.class, ParameterMode.OUT);
storedProcedure.execute();

gc1glcostctrmaps = (List<ProdureDto>) storedProcedure.getResultList();

output : 输出:

Hibernate: 
    {call GL.GLMAPOUT(?)}
2018-07-22 15:30:21.397  WARN 13916 --- [nio-8082-exec-4] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: -4472, SQLState: null
2018-07-22 15:30:21.414 ERROR 13916 --- [nio-8082-exec-4] o.h.engine.jdbc.spi.SqlExceptionHelper   : [jcc][10453][12710][3.68.61] Cannot get the describe information for the calling stored procedure with name GLMAPOUT and path ' SYSIBM , SYSFUN , SYSPROC , GLDEV ' ERRORCODE=-4472, SQLSTATE=null

but in the Data Studio it is OK 但在Data Studio中可以

enter image description here 在此处输入图片说明

If your Db2 server is running on Z/OS, then you need to upgrade your Db2 jdbc driver from its current V10.5.0.4 level (jdbc 3.0 driver version 3.68.61) to a higher version to address a known bug. 如果Db2服务器在Z / OS上运行,则需要将Db2 jdbc驱动程序从其当前的V10.5.0.4级别(jdbc 3.0驱动程序版本3.68.61)升级到更高版本,以解决已知的错误。

It appears this bug was fixed in driver versions 3.69.24 and higher. 看来此错误已在驱动程序3.69.24及更高版本中修复。

Download the latest fixpack for your Db2 client from this site . 从此站点下载适用于您的Db2客户端的最新修订包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM