facebook

Can’t reverse engineer Hibernate with IBM DB2 UDB

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #279842 Reply

    Ralph Largo
    Member

    Running 6.0.1 GA MyEclipse. I’m able to sql query and insert, but cannot generate mappings using Hibernate. Had to create Derby tables and map from them just to go forward, but now get errors when using Hibernate to insert into the DB2 mainframe system. Checked and dbl checked the db2 JDBC jar files. Ran the check Driver code and was able to see the schemas, but the tables hold no column info when connecting using db browser. DBA says we are running 8.1 DB2. Really behind now and need to release a system before end of year. Following is the log file:

    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 2007-12-19 11:27:14.541
    !MESSAGE Cannot get indices
    !STACK 0
    com.ibm.db2.jcc.b.SqlException: [jcc][10150][10300][3.50.152] Invalid parameter: Unknown column name NON_UNIQUE. ERRORCODE=-4460, SQLSTATE=null
    at com.ibm.db2.jcc.b.wc.a(wc.java:55)
    at com.ibm.db2.jcc.b.wc.a(wc.java:102)
    at com.ibm.db2.jcc.b.cb.a(cb.java:1569)
    at com.ibm.db2.jcc.b.jk.a(jk.java:1526)
    at com.ibm.db2.jcc.b.jk.getBoolean(jk.java:1279)
    at com.genuitec.eclipse.sqlexplorer.views.details.ColumnsDetail$3.run(ColumnsDetail.java:214)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
    at com.genuitec.eclipse.sqlexplorer.views.details.ColumnsDetail.activate(ColumnsDetail.java:206)
    at com.genuitec.eclipse.sqlexplorer.views.DetailManager.activate(DetailManager.java:128)
    at com.genuitec.eclipse.sqlexplorer.views.TableInfoView.setInput(TableInfoView.java:53)
    at com.genuitec.eclipse.sqlexplorer.views.DatabaseTreeViewer$3.selectionChanged(DatabaseTreeViewer.java:138)
    at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.runtime.Platform.run(Platform.java:857)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:199)
    at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
    at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2047)
    at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1138)
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1168)
    at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:227)
    at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:221)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:388)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
    at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1148)

    !ENTRY org.eclipse.core.jobs 4 2 2007-12-19 11:27:51.792
    !MESSAGE An internal error occurred during: “Generating Artifacts”.
    !STACK 0
    org.hibernate.exception.GenericJDBCException: Could not get list of tables from database. Probably a JDBC driver problem.
    Configured schema:DBTEST
    Configured catalog:null
    Available schemas:
    <SQLException while getting schemas>
    Available catalogs:

    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
    at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.handleSQLException(JDBCMetaDataDialect.java:40)
    at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:62)
    at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:433)
    at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:67)
    at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration$1.readDatabaseSchema(MEJDBCMetaDataConfiguration.java:104)
    at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:89)
    at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:137)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$7.execute(GenerateArtifactsJob.java:856)
    at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
    at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:837)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:401)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    Caused by: com.ibm.db2.jcc.b.SqlException: [jcc][10150][10300][3.50.152] Invalid parameter: Unknown column name TABLE_NAME. ERRORCODE=-4460, SQLSTATE=null
    at com.ibm.db2.jcc.b.wc.a(wc.java:55)
    at com.ibm.db2.jcc.b.wc.a(wc.java:102)
    at com.ibm.db2.jcc.b.cb.a(cb.java:1569)
    at com.ibm.db2.jcc.b.jk.a(jk.java:1526)
    at com.ibm.db2.jcc.b.jk.getString(jk.java:1369)
    at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.putTablePart(JDBCMetaDataDialect.java:103)
    at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.access$000(JDBCMetaDataDialect.java:18)
    at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.convertRow(JDBCMetaDataDialect.java:31)
    at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:59)
    … 11 more

    #279863 Reply

    Loyal Water
    Member

    Can you go through this tip and let me know if it helps:-
    https://www.genuitec.com/forums/topic/db-error-generating-artifacts/

    #279867 Reply

    Ralph Largo
    Member

    The tip says you should check your log file. I did, and I posted the whole log file in my original question. When I try to use Hibernate to reverse engineer, I get the messages I listed above. When in the DB Browser, I see the schemas, I see the tables, but none of the tables has any column information. When you click on the + sign, no data appears. Not being able to reverse engineer the tables from the mainframe give us a real problem. I checked and double checked, and we are using the correct JDBC jar files as far as I can tell. I need help asap, as we must be deploying this system before the end of the year. I have used Hibernate, MyEclipse, and other DBs, without encountering this problem, so I am at a loss. Please help.

    Thanking you in advance.

    #279886 Reply

    Loyal Water
    Member

    I checked and double checked, and we are using the correct JDBC jar files as far as I can tell.

    What driver are you using ? Can you try a different version/build to see if it helps. Your log says this issue is probably related to the driver that you are using.

    #279904 Reply

    Ralph Largo
    Member

    Yes, I know what the log says. We have tried every set of jar files we could find. All give the same error. In searching your web site, I noticed a number of posts that describe this problem exactly, however I did not ever see a solution.Some of the posts were back in 2004.

    This is not the first time this problem has shown up. Do you know of any solutions from your past posts?

    If it is not the jar files we are using, what else can it be? We are using the jb2jcc.jar and the db2jcc_license_cisuz.jar.
    Dated 11/6/2006. Another set was dated (Version 9) dated 11/12/2007. All have the same name, thanks IBM. Any other possibilities???

    If you still think it is the JDBC jar files, do you have a link to the correct ones to use for a mainframe Z/OS running Version 8.1 DB2? Any help greatly appreciated.

    #285870 Reply

    Hi,

    I know that this topic is quite old, although I’m facing the same issue, with the same DB2 version and into the OS/390 as well.
    Could you tell me what you did to resolv it ?
    Thanks

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Can’t reverse engineer Hibernate with IBM DB2 UDB

You must be logged in to post in the forum log in