I\'m trying to add a database-enabled JSP to an existing Tomcat 5.5 application (GeoServer 2.0.0, if that helps).
The app itself talks to Postgres just fine, so I kn
No matter how old this thread becomes, people would continue to face this issue.
My Case: I have the latest (at the time of posting) OpenJDK and maven setup. I had tried all methods given above, with/out maven and even solutions on sister posts on StackOverflow. I am not using any IDE or anything else, running from bare CLI to demonstrate only the core logic.
Here's what finally worked.
Class.forName(....)
. The file that we want is the com/mysql/jdbc/Driver.class
javac App.java
java --module-path com/mysql/jdbc -cp ./ App
This would load the (extracted) package manually, and your java program would find the required Driver class.
mysql
driver, other drivers might require minor changes..deb
image, you can get the jar from /usr/share/java/your-vendor-file-here.jar