Hello,
I have a problem with connecting to my hsql-database with hibernate-tools for eclipse.
Hibernate version: hibernate-tools-3.1.0-beta5, hibernate-3.1.3
Name and version of the database you are using: hsqldb-1.8
My hibernate.cfg.xml file looks like that:
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">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.password">kitty</property>
<property name="hibernate.connection.url">jdbc:hsqldb:file://D:/data/javaKittyDB</property>
<property name="hibernate.connection.username">kitty</property>
<property name="hibernate.default_schema">PUBLIC</property>
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
</session-factory>
</hibernate-configuration>
The bad thing is that I have an absolut path in my connection-url-property. But when I use a relativ path, like
Code:
<property name="hibernate.connection.url">jdbc:hsqldb:file:data/javaKittyDB</property>
it isn't possible to connect to the database. I get error
Code:
org.hibernate.exception.GenericJDBCException: Getting database metadata
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.getMetaData(JDBCMetaDataDialect.java:61)
at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:70)
at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:404)
at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:68)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$1.execute(LazyDatabaseSchemaWorkbenchAdapter.java:76)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:67)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:36)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:28)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:69)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Caused by: java.sql.SQLException: User not found: KITTY
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbcDriver.connect(Unknown Source)
at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:23)
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.JDBCMetaDataDialect.getConnection(JDBCMetaDataDialect.java:294)
at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getMetaData(JDBCMetaDataDialect.java:58)
... 11 more
It must have to do with the absolut and relativ path.
Any ideas?
Thanks in advance,
Christoph