I have java class having very simple method for database connection. Connection is established while using this code is jsp file but when i call this method from .java class it gives exception. the code i use to call that method is as fallow
<% db d = new db();
d.db1("testing", "dspace", "dspace");
%>
while the code is .java class is as fallow
public boolean db1 (String db, String username, String pwd) throws SQLException, ClassNotFoundException
{
Connection connection;
Class.forName("org.postgresql.Driver");
connection = DriverManager.getConnection(
"jdbc:postgresql:5432//127.0.0.1:5432/testing", username,
pwd);
if(connection!= null)
{
System.out.println("done");
}
return false;
}
there error is
org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP