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.  [ 3 posts ] 
Author Message
 Post subject: DB2 dialect - error in SessionFactory
PostPosted: Sun Aug 02, 2009 10:51 am 
Newbie

Joined: Sun Aug 02, 2009 10:40 am
Posts: 2
Hi,
I am trying to write hibernate application with DB2 8.1. hibernate.cfg.xml file that I have written is as follows:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>

<property name="hibernate.connection.driver_class">COM.ibm.db2.jdbc.app.DB2Driver</property>
<property name="hibernate.connection.url">jdbc:db2:TRNG</property>
<property name="hibernate.connection.username">db2admin</property>
<property name="hibernate.connection.password">db2admin</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.DB2Dialect</property>
<property name="hibernate.hbm2ddl.auto">create-drop</property>

</session-factory>
</hibernate-configuration>


When I am trying to incorporate reverse engineering procedure I got the following error in SessionFactory.

Error
Sun Aug 02 19:11:57 IST 2009
<Sessionfactory error: Dialect class not found: net.sf.hibernate.dialect.DB2Dialect>

org.hibernate.HibernateException: Dialect class not found: net.sf.hibernate.dialect.DB2Dialect
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:81)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:42)
at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:492)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:94)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:487)
at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:43)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:99)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:105)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

I have already placed db2java.zip file in the classpath. I am confused if the dialect are not perfect or not. Could you please help me out?

Regards
Soumya


Top
 Profile  
 
 Post subject: Re: DB2 dialect - error in SessionFactory
PostPosted: Sun Aug 02, 2009 2:11 pm 
Newbie

Joined: Sun Aug 02, 2009 2:08 pm
Posts: 1
If you aren't sure about the jar you are using, you can try finding the right jar here:
http://www.ellipsissolutions.com/xray.php

Hope this helps.

Thanks!
GT


Top
 Profile  
 
 Post subject: Re: Error fetching children of DB2 using reverse engineering
PostPosted: Sun Aug 02, 2009 2:49 pm 
Newbie

Joined: Sun Aug 02, 2009 10:40 am
Posts: 2
Hi,

I have fixed that problem. I need to specify org.hibernate.dialect.DB2Dialect in space of Dialect specification i.e.
<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
will work.

But I am facing another problem while trying to do reverse engineering procedure.
I am receiving the following error while trying to fetch the associated tables under the particular schema.
Error is:
An internal error occurred during: "Fetching children of Database". class loading constraint violated (class: com/ibm/db2/jcc/c/p method: getSQLJLogWriter()Lcom/ibm/db2/jcc/SQLJLogWriter;) at pc: 0

Could you please highlight any thing on this, how can I resolve this error?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.