Gente, adquiri um livro sobre desenvolver aplicações em JSP pelo IDE NetBeans, porem já no primeiro exemplo estou encontrando dificuldades para conectar ao mySQL, pois o livro foi confeccinado por uma IDE mais antiga (acredito eu).
Estou rodando com o NetBeans 6.8, mySQL 5, JDK 6 e o connecto 5, ao criar o codigo abaixo me apresenta que está em anexo
segue codigo:
<%@ page import=“java.sql.*”%>
Seus usuários são:<% Class.forName("com.mySQL.jdbc.Driver"); Connection con=DriverManager.getConnection( "jdbc:mySQL://localhost:3306/mySQL?useUnicode=true", "root", "root"); Statement stm=con.createStatement(); ResultSet res=stm.executeQuery(("select user fron user")); while (res.next()){ out.println(res.getString(1)+"
"); } res.close(); %>
HTTP Status 500 -
type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.ClassNotFoundException: com.mySQL.jdbc.Driver
root cause
java.lang.ClassNotFoundException: com.mySQL.jdbc.Driver
note The full stack traces of the exception and its root causes are available in the GlassFish v3 logs.
GlassFish v3
Contando com a ajuda de todos
Marcelo Nogueira