db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen <Oystein.Grov...@Sun.COM>
Subject Re: Hibernate: table/view does not exist
Date Thu, 27 Sep 2007 06:38:39 GMT
Mathias Conradt wrote:
 > Thanks for the hint, the schema is app.
 >
 > It seems that when I use ij (EmbeddedMode) to connect to
 > jdbc:derby:realty;(create=true) and use hibernate, it 
creates/connects the
 > database in two different physical location. When I use ij, the database
 > folder is created under C:\server\javadb10.3.1.4\bin, but when I use
 > Hibernate, it must be somewhere else, at least I cannot find it under
 > C:\server\javadb10.3.1.4\bin.

Note that if you do not specify yourself where the database is to be
stored, it will be stored in current directory.  I am not a Windows
expert, but from your experience it seems like the current diretory
may be the directory where the executable is located.

You can take control of where the database is located in at least two
ways:

1. Set the property derby.system.home to the directory where you want
    your database.

2. Explicitly state the location of your database when connecting:

    URL: jdbc:derby:C:/server/javadb10.3.1.4/bin/realty

 > But now I found a solution, using the Server Mode instead of the Embedded
 > Mode, which somehow makes sure that I'm using the same (physical) 
database.
 > <property
 > 
name="driverClass"><value>org.apache.derby.jdbc.ClientDriver</value></property>
 > <property
 > 
name="jdbcUrl"><value>jdbc:derby://localhost:1527/realty;create=true</value></property>
 >

The server mode works because the default directory when starting the
server will be used regardless of which client is connecting to it.
However, there should be no need to use the client/server mode if you
do not need to support concurrent connections from multiple clients.

Hope this helps,

Øystein


Mime
View raw message