Dear guys

I am rather new to Java and Java databases. Now I have just installed netbeans v6.1 together with derby (javaDB) on win XP, SP 2. Creating and running java programs is ok, but I can't start derby server from netbeans services menu. NetBeans tells me: java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl. Exception in thread "main".

Question 1: Does this mean that derby.jar is not in classpath?

My current classpath is:
.;C:\Program\Java\jre1.6.0_02\lib\ext\QTJava.zip

Question 2: Is this a correct classpath? Should there not be a semicolon ; between two entries? I am wondering why \lib\ext\QTJava.zip is in classpath. I didn't add it.

Question 3: How should my classpath look like if derby.jar is in path: C:\Program\glassfish-v2ur2\javadb\lib ? Do I have to pay attention not to overwrite important parts of classpath already set?

I really appreciate every help. Thank you very much.

yap

Have you tried to run any other java programs (that don't use connecton to DB) successfully?

Try to do this: Right-click on the project, Properties, Add jar, and add the derby.jar

Have you tried to go to Services tab and connect to the database of your choice?

Thank you Javaaddict (efharisto para poli :) ) for fast reply.

Yes, other Java programs (without database) run successfully.

If I connect to other database (already created with NetBeans v.5.0.1, there they work properly) I get following errors:

In Qutput java DB Process windows:
java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
Exception in thread "main"

In final popup error window:
The class.org.apache.derby.jdbc.clientDriver was not found.
Add the relevant driver using the New Driver action on the Drivers node

A year ago, when I started Java with javaBD all things worked perfectly. Even the great tutorial http://www.netbeans.org/kb/60/java/gui-db.html I exercised successfully. Now after having upgraded to version 6.1 I am not able to run any older database nor I am able to create new one, no matter whether it is server derby.jar or embedded derbyclient.jar.

Any idea to solve this problem. Maybe it is the classpath. Or shall i go back to old version 5.0.1

Thank you for any advice.

---
yap

Sorry, wrong version number 5.0.1 of Netbeans in my previous post. It should be 6.0.1 (as compared to the today current 6.1).
---
yap

n final popup error window:
The class.org.apache.derby.jdbc.clientDriver was not found.
Add the relevant driver using the New Driver action on the Drivers node

If you have added the derby.jar file at the properties of the project, all I can think of is that that you haven't selected the appropriate driver based on the above message.

What kind of code are you using to connect to the database:
Class.forName(?);
What parameters are you passing when you get the connection from DriverManager?

I can't think of anythning else because I don't use netbeans "connections" for the database

You did not set up PATH to your installation of Java. Have look at this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.