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
I faced the similar issue. My Project in context is Dynamic Web Project(Java 8 + Tomcat 8) and error is for PostgreSQL Driver exception: No suitable driver found
It got resolved by adding Class.forName("org.postgresql.Driver")
before calling getConnection()
method
Here is my Sample Code:
try {
Connection conn = null;
Class.forName("org.postgresql.Driver");
conn = DriverManager.getConnection("jdbc:postgresql://" + host + ":" + port + "/?preferQueryMode="
+ sql_auth,sql_user , sql_password);
} catch (Exception e) {
System.out.println("Failed to create JDBC db connection " + e.toString() + e.getMessage());
}