-->
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.  [ 2 posts ] 
Author Message
 Post subject: absolut and relative path for jdbc connection-url
PostPosted: Sat May 20, 2006 4:02 am 
Regular
Regular

Joined: Sat May 20, 2006 3:49 am
Posts: 78
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


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 20, 2006 5:03 am 
Regular
Regular

Joined: Sat May 20, 2006 3:49 am
Posts: 78
Hmmm... it seems it tries to open the database in C:\Programme\eclipse-SDK-3.1.2-win32\eclipse when I use a relative path. Why?


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