Gente não tô conseguindo encontrar o erro na minha aplicação jsp.
Tô só brincando [estudando claro] com o JSP+Mysql no Netbeans.
Tenho uma página "Pesquisa.jsp"
O banco conecta normal pelo Netbeans, eu incluo e excluo dados, normal!
Mas qnd eu executo a página abaixo "Pesquisa.jsp", dá o erro.
<%--
Document : Pesquisa
Created on : 11/01/2010, 20:34:49
Author : Onix
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%
String url1 = "jdbc://localhost:3306/bird";
String usuario = "root";
String senha = "adm2009";
Connection con = null;
Statement stm = null;
ResultSet res = null;%>
<html>
<body bgcolor=#E0E0E0 >
<TABLE>
<b>Pesquisa com SELECT Mysql :</b><br>
</TABLE>
<%Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(url1, usuario, senha);
stm = con.createStatement();
res = stm.executeQuery("SELECT * FROM cadastro");
while (res.next()){
out.println(res.getString("nome")+"<br>");
}
res.close();%>
</body>
</html>
No código não acusa nenhum erro.
Mas na página aparece isso aki...
type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc://localhost:3306/bird
root cause
java.sql.SQLException: No suitable driver found for jdbc://localhost:3306/bird
note The full stack traces of the exception and its root causes are available in the GlassFish/v3 logs.
Alguém pode me ajudar?
Não sei se é o Driver do connector j, Onde ele tem que estar? tem que ter o endereço no classpath?
