On 19.05.10 19:20, nm56 wrote:
Thanks but it's still not working. Every time I either try to do the
:classpath or :jar options to connect to my db within a jar file it says
'jar:db_name' or 'classpath:db_name' not found.
Is this a bug? Do I need to specify this part as a parameter to databaseName
instead of this subprotocol?
I don't think you have to use the databaseName parameter.
Maybe you get more help if you describe what you have on your classpath
and post the connection URL?
Also, have you consulted the manuals on how to specify the database when
using the jar or classpath subsubprotocol?
Regards,
--
Kristian
Kristian Waagan-4 wrote:
On 19.05.10 16:49, nm56 wrote:
Hi, a little background:
I'm zipping up a Java App along with a derby db that I created using the
network server.
Is it possible to read a locally or transplanted derby db that was
created
and saved using the network driver by using the embedded driver to read
it
or are they just incompatible as I suspect?
Hi,
You can read a database created by the network server with the embedded
driver.
As a matter of fact, the Derby network server is using the embedded
driver internally to access the database.
If they are incompatible, how can I tell the server the location of the
database I want to access if it is outside of DERBY_HOME?
I suppose you meant compatible here?
You have a few options, but assuming you want read/write access, you can
specify the absolute or relative path to the database in the connection
URL.
For instance:
'jdbc:derby:/my/db/dir/db'
'jdbc:derby:../dbs/mydb'
If you only need read access, you can access the database from a JAR/zip
or from the classpath. See the manual(s) for details.
If you need throw-away databases, you can either create/copy a new
database from a backup/master, or you can boot a backup/master into
memory (non-persisted db) using the in-memory protocol. You can do these
things either by copying the database directory using you OS tools (cp
or copy), or you can use the createFrom/restoreFrom connection attributes.
Hope this helps,
--
Kristian
Thanks for any help...