I'm getting a "driver not found" exception when running a relatively
trivial derby program from within eclipse. It's frustrating because I
can crack the derby.jar file and the targeted driver class is in the
derby.jar file that is in the build path for the project.
The targeted driver is "Borg.apache.derby.jdbc.ClientDriver" and it's
found in the derby.jar file that is the first library on my build path.
I'm going through the Eclipse plug-in labs in order to get a baseline
"Hello World" environment validated when I encountered this error.
With the fix I got the other day, things were going great. I
successfully ran the procedures that create the stored procedures and
test them (stored_procedures.sql, and execute_sp.sql). This tells me
that the DB server is running on my local server at the port expected.
When I take it to the next level and run the actual Java application
"Jays.java" that I see any problems. Stripping it down to the simplest
code, I get the following:
private static final String derbyClientDriver =
"org.apache.derby.jdbc.ClientDriver";
private static final String derbyClientURL =
"jdbc:derby://localhost:1527/jayDB:user=APP;password=APP;";
public static void main(String[] args) throws Exception {
runDriver(derbyClientDriver, derbyClientURL);
} // method main
private static void runDriver(String driverName, String driverURL)
throws ClassNotFoundException, SQLException, Exception {
Class.forName(driverName);
Connection conn = DriverManager.getConnection(driverURL); // dies
readCommands(conn);
conn.close();
} // method runClientDriver
--
A. Rick Anderson