Erro na conecção
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 15 in the jsp file: /login.jsp
Connection cannot be resolved to a type
12: Class.forName("org.postgresql.Driver");
13: out.println("Drivers carregados!");
14:
15: Connection con = DriverManager.getConnection("jdbc:postgresql://localhost/padaria","admin","panificadora");
16: out.println("Conexao efetuada!");
17:
18: // Statement st = con.createStatement();
An error occurred at line: 15 in the jsp file: /login.jsp
DriverManager cannot be resolved
12: Class.forName("org.postgresql.Driver");
13: out.println("Drivers carregados!");
14:
15: Connection con = DriverManager.getConnection("jdbc:postgresql://localhost/padaria","admin","panificadora");
16: out.println("Conexao efetuada!");
17:
18: // Statement st = con.createStatement();
An error occurred at line: 25 in the jsp file: /login.jsp
SQLException cannot be resolved to a type
22: {
23: out.println("Class Driver JDBC não foi localizado, erro = "+erroClass);
24: }
25: catch(SQLException erroSQL)
26: {
27: out.println("Erro de conexão com o Banco de dados, erro = "+erroSQL);
28: }
An error occurred at line: 8 in the jsp file: /login.jsp
erroSQL cannot be resolved
5:
6: <body>
7:
8: <%
9: try
10: {
11: //Carregando os drivers
Esse é o código que retorna esse erro
<body>
<%
try
{
//Carregando os drivers
Class.forName("org.postgresql.Driver");
out.println("Drivers carregados!");
Connection con = DriverManager.getConnection("jdbc:postgresql://localhost/padaria","admin","panificadora");
out.println("Conexao efetuada!");
// Statement st = con.createStatement();
// out.println("Passou pelo statement");
}
catch(ClassNotFoundException erroClass)
{
out.println("Class Driver JDBC não foi localizado, erro = "+erroClass);
}
catch(SQLException erroSQL)
{
out.println("Erro de conexão com o Banco de dados, erro = "+erroSQL);
}
%>
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 15 in the jsp file: /login.jsp
Connection cannot be resolved to a type
12: Class.forName("org.postgresql.Driver");
13: out.println("Drivers carregados!");
14:
15: Connection con = DriverManager.getConnection("jdbc:postgresql://localhost/padaria","admin","panificadora");
16: out.println("Conexao efetuada!");
17:
18: // Statement st = con.createStatement();
An error occurred at line: 15 in the jsp file: /login.jsp
DriverManager cannot be resolved
12: Class.forName("org.postgresql.Driver");
13: out.println("Drivers carregados!");
14:
15: Connection con = DriverManager.getConnection("jdbc:postgresql://localhost/padaria","admin","panificadora");
16: out.println("Conexao efetuada!");
17:
18: // Statement st = con.createStatement();
An error occurred at line: 25 in the jsp file: /login.jsp
SQLException cannot be resolved to a type
22: {
23: out.println("Class Driver JDBC não foi localizado, erro = "+erroClass);
24: }
25: catch(SQLException erroSQL)
26: {
27: out.println("Erro de conexão com o Banco de dados, erro = "+erroSQL);
28: }
An error occurred at line: 8 in the jsp file: /login.jsp
erroSQL cannot be resolved
5:
6: <body>
7:
8: <%
9: try
10: {
11: //Carregando os drivers
Esse é o código que retorna esse erro
<body>
<%
try
{
//Carregando os drivers
Class.forName("org.postgresql.Driver");
out.println("Drivers carregados!");
Connection con = DriverManager.getConnection("jdbc:postgresql://localhost/padaria","admin","panificadora");
out.println("Conexao efetuada!");
// Statement st = con.createStatement();
// out.println("Passou pelo statement");
}
catch(ClassNotFoundException erroClass)
{
out.println("Class Driver JDBC não foi localizado, erro = "+erroClass);
}
catch(SQLException erroSQL)
{
out.println("Erro de conexão com o Banco de dados, erro = "+erroSQL);
}
%>
Leonardo
Curtidas 0