JDBC connection to derby from an applet

I'm doing the JDBC tutorial at java.sun.com

Everything runs fine from the Netbeans IDE. I'm not sure whether the applet is supposed to work inside the IDE or not, I figure that's meant for the web.

Within Netbeans, the following URL works:

String url = "jdbc:derby:C:\\Documents and Settings\\HP_Administrator\\.netbeans-derby\\helpme";

When I load a webpage with the applet, I get:

java.SQLException: No suitable driver found for jdbc:derby:C:\Documents and Settings\HP_Administrator\.netbeans-derby\helpme.

Now, I know it found the driver Class, otherwise I would have gotten Class Not Found -- so I assume its just not making the connect to the database from the applet.

I have tried many formats for the url --

String url = "jdbc:derby://localhost:1527/C:\\Documents and Settings\\HP_Administrator\\.netbeans-derby\\helpme";

String url = "jdbc:derby://localhost:1527/helpme";

String url = "jdbc:derby:helpme";

Nothing I've tried has worked. Can someone point me in the right direction please?

Everything is running on the same machine.

[1122 byte] By [kbrammer73a] at [2007-11-27 9:50:06]
# 1

"No suitable driver" is an error message which can indicate an improper URL. And in your case, you will want to avoid including any reference to the C: drive in your url. The format for the url can also depend upon the database you are using. So for example an mysql url would begin with

jdbc:mysql://localhost:3306

> String url = "jdbc:derby://localhost:1527/helpme";

This suggestions that you may be using a database server called derby which utilizes port 1527 and that your particular database is called helpme.

In any case you will want to look at documentation for your particular database software ( MSAccess, MySQL, Oracle etc ) to determine how to construct the url.

nantucketa at 2007-7-13 0:18:41 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...