I have Deployed jar file of postgres current version in eclipse (web-inf/lib) foleder but still Class.forName not laoded`, when I open perspective with same settings then it is connected open Perspectice image,please view on clicking it
Connection connect() throws SQLException,ClassNotFoundException {
System.out.println("welcome to the world of database");
Connection conn = null;
try {
Class.forName("org.postgresql.Driver");
System.out.println("class loaded");
}catch(ClassNotFoundException e){
System.out.println("class not loaded");
}
conn=DriverManager.getConnection("jdbc:postgresql://localhost:2345/my_first_databse", "postgres","postgres");
System.out.println("Connected to the PostgreSQL server successfully.");
return conn;
}//eof connect
output: welcome to the world of database class not loaded No suitable driver found for jdbc:postgresql://localhost:2345/my_first_databse