Hello !
First of all, please exuse me if there's somewhere an answer to my questions, but after some hours on google i haven't found it. But you can prove me that i don't know how to search on google -in which case i guess i'll look for some tutorials :D.
Well, before going to the questionning part, you may wanna know which version of hibernate i use. In fact, i'm trying to run hibernate3 -hibernate tools 3.2.4 CR2- with eclipse ganymede and MS SQL Server 2005.
My issue is kinda simple, but very annoying. When i want to see my tables, in my hibernate configuration, i got this error : "Problem while reading database schema"
Here is the stack trace :
Code:
org.hibernate.exception.JDBCConnectionException: Getting database metadata
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getMetaData(AbstractMetaDataDialect.java:64)
at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.caseForSearch(AbstractMetaDataDialect.java:163)
at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:22)
at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:476)
at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:74)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$2.execute(LazyDatabaseSchemaWorkbenchAdapter.java:114)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:105)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:61)
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)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://DBSRV.oneid.fr\\TEST;DatabaseName="rh";SelectMethod=cursor
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getConnection(AbstractMetaDataDialect.java:122)
at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getMetaData(AbstractMetaDataDialect.java:61)
... 11 more
I tried with some drivers (jTDS, Microsoft and an old Microsoft one that worked some days ago) and i got the same result; so, since i added thoses drivers -one at a time- in my project and my classpath i think my problem comes from the hibernate.cfg.xml
So here is this file in which i replaced the password by some stars ;):
Code:
<?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.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="hibernate.connection.password">******</property>
<property name="hibernate.connection.url">jdbc:sqlserver://DBSRV.oneid.fr\\TEST;DatabaseName=rh;SelectMethod=cursor</property>
<property name="hibernate.connection.username">apexrh</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
</session-factory>
</hibernate-configuration>
Please note that tere is no mapping for now, for i want to generate the classes from the tables.
I hope someone can help me to figure out what i have forgotten to configure.
Regards