DB2 JPA entities from table

你说的曾经没有我的故事 提交于 2019-12-11 18:52:52

问题


I'm trying to generate JPA entities from table through the Eclipse Wizard. The database is AS400-DB2. I've set the properties in this way: database: ACG_COMTST URL: jdbc:as400://192.168.3.54 username: username password: password

ACG_COMTST is the AS400 library.

When I press test connection I get success. But I can't see any table to select in the wizard


回答1:


Dali, the Eclipse plug-in that supplies the entity generation wizard you are using, relies on another Eclipse plug-in, DTP, to provide the database metadata necessary to perform the entity generation. As a result, this problem could be caused by either plug-in.

A simple way to (possibly) isolate the problem is to use DTP's Data Source Explorer view to see what DTP is returning in the way of metadata. Use this view to connect to your AS400-DB2 database. (You will be using the same connection profile you created in the Dali Entity Generation wizard.) Once you are connected you should be able to expand the tree to see your tables. If there are no tables, the problem is with the DTP adapter used to retrieve metadata from your database and this is a problem with DTP; if there are tables in the tree, the problem is with Dali.

Also, you should look at the Eclipse log (./.metadata/.log) to see if any sort of exception occurs when you are using the Dali wizard.




回答2:


I just spent a half a morning trying to figure this out myself. The answer lies in the "Override default catalog from connection" about halfway down the Project|Properties|JPA page. You must set this to the actual catalog that holds your schema, typically the server name. It defaults to the username you provide for the connection.



来源:https://stackoverflow.com/questions/16936741/db2-jpa-entities-from-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!