I had the same problem when I was writing Java application on Netbeans.Here is the solution:
Find your project in projects selection tab
Right click "Libraries"
Click "Add JAR/Folder..."
Choose "derbyclient.jar"
Click "Open", then you will see "derbyclient.jar" under your "Libraries"
Make sure your URL, user name, pass word is correct, and run your code:)