Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Connecting to Derby using EmbeddedDriver
Connecting to Derby using EmbeddedDriver [message #379613] Tue, 19 August 2008 17:42 Go to next message
Joel Rosi-Schwartz is currently offline Joel Rosi-Schwartz
Messages: 624
Registered: July 2009
Location: London. England
Senior Member
I am trying to set up EclipseLink to access a Derby embedded database
using the EmbeddedDriver. I keep on getting this exception:

No suitable driver found for
jdbc:derby:H:/jotter/database/prova4derek;create=true

I am using the Orbit Derby bundle, but when things when I could not
connect I copied in the derby.jar instead to make sure that it was not
a problem with the way I was using the Orbit bundle. Both give me
identical errors.

As a sanity check I have ran the same URL from within the Derby ij
console and it works as expected.

So what am I missing? Your advice would be greatly appreciated.

Many thanks,
Joel

Here is the persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="maia">
<class>a2d.poa.derby.model.ToxData</class>
<class>a2d.poa.derby.model.Species</class>
<properties>
<property name="eclipselink.jdbc.driver"
value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="eclipselink.jdbc.url"
value="jdbc:derby:H:/jotter/database/prova4derek;create=true " />
<property name="eclipselink.jdbc.user" value="admin" />
<property name="eclipselink.jdbc.password" value="secret" />
<property name="eclipselink.jdbc.read-connections.min"
value="1" />
<property name="eclipselink.jdbc.write-connections.min"
value="1" />
<property name="eclipselink.jdbc.batch-writing" value="JDBC" />

<!-- DB schema creation -->
<property name="eclipselink.ddl-generation"
value="drop-and-create-tables" />
<property name="eclipselink.ddl-generation.output-mode"
value="database" />

<!-- Logging -->
<property name="eclipselink.logging.level" value="FINE" />
<property name="eclipselink.logging.timestamp" value="false" />
<property name="eclipselink.logging.session" value="false" />
<property name="eclipselink.logging.thread" value=a"false" />
</properties>
</persistence-unit>
</persistence>
Re: Connecting to Derby using EmbeddedDriver [message #379620 is a reply to message #379613] Wed, 20 August 2008 11:38 Go to previous message
Joel Rosi-Schwartz is currently offline Joel Rosi-Schwartz
Messages: 624
Registered: July 2009
Location: London. England
Senior Member
After a bit more investigation I found that even though I was getting
this exception my connection to the database was in fact successful.
So I am wondering why the original warning and underlying the exception.

Here is an excerpt of the Eclipselink output during start up:

[EL Warning]: java.sql.SQLException: No suitable driver found
for jdbc:derby:H:/jotter/database/prova4derek;create=true
[EL Fine]: Detected Vendor platform:
org.eclipse.persistence.platform.database.JavaDBPlatform
[EL Config]: Connection(933741)--connecting(DatabaseLogin(
platform=>JavaDBPlatform
user name=> "admin"
datasource URL=>
"jdbc:derby:H:/jotter/database/prova4derek;create=true"
))
[EL Config]: Connection(7845780)--Connected:
jdbc:derby:H:/jotter/database/prova4derek
User: admin
Database: Apache Derby Version: 10.4.1.3 - (648739)
Driver: Apache Derby Embedded JDBC Driver Version: 10.4.1.3 -
(648739)
[EL Config]: Connection(28671435)--connecting(DatabaseLogin(
platform=>JavaDBPlatform
user name=> "admin"
datasource URL=>
"jdbc:derby:H:/jotter/database/prova4derek;create=true"
))
[EL Config]: Connection(8509315)--Connected:
jdbc:derby:H:/jotter/database/prova4derek
User: admin
Database: Apache Derby Version: 10.4.1.3 - (648739)
Driver: Apache Derby Embedded JDBC Driver Version: 10.4.1.3 -
(648739)
[EL Info]: bundleresource://2131/-maia login successful

Any insight would be appreciated.

All the best,
Joel
--
Joel Rosi-Schwartz
Etish Limited [http://www.etish.org]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^...^
/ o,o \ The proud parents of Useme
|) ::: (| The Open Requirements Management Too
====w=w==== [https://useme.dev.java.net]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previous Topic:First steps
Next Topic:Cache not refreshing?
Goto Forum:
  


Current Time: Fri Oct 24 18:06:30 GMT 2014

Powered by FUDForum. Page generated in 0.11205 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software