Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Derby Connection Problem.

Hi all,

I am trying to establish connection with Derby(Java DB) through Service but am getting following error. "java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver"

Here is the piece of my database connectivity code.
---

try
{
Connection conn;
String driver = "org.apache.derby.jdbc.ClientDriver";
Class.forName(driver).newInstance();
writer.println("Connected to the database");
conn.close();
writer.println("Disconnected from database");
}

catch (Exception e)
{
writer.println(e);
}

---

Guide me how to register my derby database. Is there any other code snipet that you may want to share.

Thanks in advance.

0 votes



One answer

Permanent link
Are you using standalone or embedded Derby? Since you are asking the question on jazz.net forum, I suppose you are referring to the embedded Derby database of the Jazz applications. In this case, keep in mind that only one JVM can open the Derby database.

Derby supports multiple connections to a given database. An example of an embedded application that manages concurrent users is a Tomcat or Geronimo application server that embeds Derby. Any number of users can execute Web applications that access a database through that Web server.

However, only one JVM may boot ("open") that database, so multiple applications running in different JVMs cannot access the same database. To understand this better, do the following.

Quoted from http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html

If you are working on projects not relating to Jazz, you'd better gather information from the general Derby source, such as below.
http://db.apache.org/derby/papers/DerbyTut/index.html

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: May 28 '08, 2:41 a.m.

Question was seen: 6,757 times

Last updated: May 20 '14, 9:14 p.m.

Confirmation Cancel Confirm