-->
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.  [ 11 posts ] 
Author Message
 Post subject: Generate Artifact and jdbc-driver for MS Access
PostPosted: Mon Sep 26, 2005 11:18 am 
Newbie

Joined: Mon Sep 26, 2005 10:57 am
Posts: 6
Hi. I'm new to Hibenate and I'm trying to use the Generate Artifact tool for mapping a MS Access XP database via jdbc-odbc driver.

I've followed all the procedure described in the documentation (demo)...so I've generated the hibernate.cfg.xml in this way:

<?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.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.connection.url">jdbc:odbc:AuthorsDB</property>
<property name="hibernate.connection.driver_class">sun.jdbc.odbc.JdbcOdbcDriver</property>
</session-factory>
</hibernate-configuration>


Next I've generated the Console Configuration using in driver classpath rt.jar that contain the sun.jdbc.odbc.JdbcOdbcDriver.

Finally I try to generate Artifact from my DB via the jdbc-odbc driver but I recieve an error windows that say:
-------------------------------------------------------------------------------
Error under artifact generation
Reason:
org.hibernate.exception.GenericJDBCException: Reading from database
--------------------------------------------------------------------------------

I'm using Eclipse 3.1 M1 with the JBossIDE 1.5.0M2 (that contains also Hibernate Tools I suppose)

Can you help me in some way?

Thx in advace! ;)

P.S.
I know that MS Access and jdbc-odbc bridge is a bad choice ...but I'm forced to it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 11:30 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
show the complete stack trace (available in the Error log view)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 11:40 am 
Newbie

Joined: Mon Sep 26, 2005 10:57 am
Posts: 6
Oh sorry!...It's that:

org.hibernate.exception.GenericJDBCException: Reading from database
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:96)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:37)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:237)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:77)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:234)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:164)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:132)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:98)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: java.sql.SQLException: [Microsoft][Driver Manager ODBC] Il driver non supporta questa funzione
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLPrimaryKeys(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getPrimaryKeys(Unknown Source)
at org.hibernate.cfg.JDBCBinder.processPrimaryKey(JDBCBinder.java:941)
at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:124)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:91)
... 8 more


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 11:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and if you read the exception it says it all:

Caused by: java.sql.SQLException: [Microsoft][Driver Manager ODBC] Il driver non supporta questa funzione

Which to me look like the driver does not support getting metadata, so no luck.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 11:46 am 
Newbie

Joined: Mon Sep 26, 2005 10:57 am
Posts: 6
What sadness...thx anyway! ;)

I hate using jdbc-odbc drivers!!! But I can't buy a MS Access jdbc commercial driver.

Do you know if there's some jdbc driver for MS Access avaiable for free?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 11:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 9:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I am not sure what your use case is. I would suggest you change to HSQL rather then using Access, its small, fast and has good JDBC driver support.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 3:07 am 
Newbie

Joined: Mon Sep 26, 2005 10:57 am
Posts: 6
I know...but is for my master thesis and I'm working for a project where I must use a db that is only on Access. I only need to read from this DB for creating an Ontology in OWL.

I know it's not a good choice but I'm forced to use it.

Thx for the support.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 6:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I did found a library, yesterday when hunting, that is not a JDBC driver but claims to be able to read and write from an Access database.

See:
http://en.wikipedia.org/wiki/Microsoft_Access

more specifically
http://jackcess.sourceforge.net

Maybe this will help.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 6:07 pm 
Newbie

Joined: Mon Sep 26, 2005 10:57 am
Posts: 6
Oh...thx..really. :-D I gonna check now this topic and eventually I'll tell you if it works!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 6:22 pm 
Newbie

Joined: Mon Sep 26, 2005 10:57 am
Posts: 6
I read about jackcess...but It seem's to be a kind of API for manipulating directly an Access Db. Something like displaing and creating tables. But it'snt a real JDBC driver and so I can't use it with Hibernate Persistence.

Really sad! But it seems that is impossible to get some MS Access JDBC driver for free.

And the worst is that with JDBC-ODBC bridge I'm really having so mutch trouble! I'm going creazy even for a simple EntityManager.find!

Thanx anyway for your help. ;-)


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