问题
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