-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: DB2 and hibernate artifact generation
PostPosted: Wed May 25, 2005 3:24 pm 
Newbie

Joined: Tue May 24, 2005 6:31 pm
Posts: 7
Trying to perform hibernate artifact generation out of a DB2 database.

searched the forums, found a few related things, tried what people suggested to try, all without success.

IBM WSAD, configured against the same driver, using the same database URL/username/password, and etc, can connect to this database and reverse engineer it just fine (so i have difficulty believing it is a "driver problem").

the hibernate tools (alpha) cannot.

the pertinent information follows. any help would be greatly appreciated. i will try anything!. failing that, some information on when the next revision of the hibernate tools will be available will be very welcome. we need a toolset for managing our mappings, developing/maintaining all that XML by hand, between a large/complex legacy schema and what will eventually become a large/complex object model, is not attractive to us :-).

thanks.

Hibernate version:

org.hibernate.eclipse.feature 3.0.0.alpha (running in eclipse 3.1m4)

Mapping documents (hibernate.cfg.xml):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username">ouruser</property>
<property name="hibernate.connection.password">***</property>
<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="hibernate.connection.url">jdbc:db2://ourhost:5021/FOACDB2D</property>
<property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.default_schema">DEVDISD</property>
</session-factory>
</hibernate-configuration>

Code between sessionFactory.openSession() and session.close():

none.

Full stack trace of any exception that occurs:


!ENTRY org.hibernate.eclipse.console.HibernateConsolePlugin 4 4 2005-05-25 12:00:55.643
!MESSAGE Error under artifact generation
!STACK 0
org.hibernate.exception.GenericJDBCException: Could not get list of tables from database. Probably a JDBC driver problem.
Configured schema:null
Configured catalog:null
Available schemas:
?? Couldn't get schemas ??
Available catalogs:

at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.cfg.JDBCBinder.readTables(JDBCBinder.java:606)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:101)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:213)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:105)
Caused by: com.ibm.db2.jcc.c.SqlException: Invalid argument: unknown column name TABLE_NAME
at com.ibm.db2.jcc.c.m.a(m.java:1262)
at com.ibm.db2.jcc.c.rc.a(rc.java:1368)
at com.ibm.db2.jcc.c.rc.getString(rc.java:1227)
at org.hibernate.cfg.JDBCBinder.readTables(JDBCBinder.java:568)
... 9 more
!SUBENTRY 2 org.hibernate.eclipse.console.HibernateConsolePlugin 4 150 2005-05-25 12:00:55.643
!MESSAGE Invalid argument: unknown column name TABLE_NAME
!STACK 0
com.ibm.db2.jcc.c.SqlException: Invalid argument: unknown column name TABLE_NAME
at com.ibm.db2.jcc.c.m.a(m.java:1262)
at com.ibm.db2.jcc.c.rc.a(rc.java:1368)
at com.ibm.db2.jcc.c.rc.getString(rc.java:1227)
at org.hibernate.cfg.JDBCBinder.readTables(JDBCBinder.java:568)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:101)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:213)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:105)

Name and version of the database you are using:

DB2 OS/390 7.1.2

The generated SQL (show_sql=true):

none.

Debug level Hibernate log excerpt:

none.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 4:16 pm 
Newbie

Joined: Tue May 24, 2005 6:31 pm
Posts: 7
downloaded and tried:

org.hibernate.eclipse.feature 3.0.0.alpha2 (running in eclipse 3.1m5a)

it fails identically, as far as i can tell.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 6:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
so apparently the driver doesnt support jdbc metadata ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 4:58 pm 
Newbie

Joined: Tue May 24, 2005 6:31 pm
Posts: 7
i have rummaged around various IBM support help websites.

it appears to be fairly conclusive that the IBM DB2 universal drivers support metadata fully. however, OS/390 aid z/OS installations of DB2 treat the underlying stored procedures required to support metadata as *options*, not automatically installed. and of course, we are indeed running DB2 on the mainframe.

i am exploring this with our DBA group as i write this :-). it is entirely possible (being a legacy mainframe shop incrementally moving towards enterprise java) that this stored procedure infrastructure is simply not installed.

i will post back here as i discover new things :-).

thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 5:41 pm 
Newbie

Joined: Tue May 24, 2005 6:31 pm
Posts: 7
yes, we were able to run the hibernate tools successfully against a windows installation of DB2, where these metadata stored procedures are installed by default.

we also had the java.lang.OutOfMemoryError:

http://forum.hibernate.org/viewtopic.php?t=942499


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.