You need to obtain the JAR file in which the driver for your database is located. If you use Derby, you need the file
derbyclient.jar. With another database, you need to locate the appropriate driver. For example, the PostgreSQL drivers are available at http://jdbc.postgresql.org.
Include the driver JAR file on the class path when running a program that accesses the database. (You don’t need the JAR file for compiling.)
When you launch programs from the command line, simply use the command
java -classpath driverPath:. ProgramName
On Windows, use a semicolon to separate the current directory (denoted by the
. character) from the driver JAR location.