Hello Everyone,
I'm creating a simple JSP page (helloworld.jsp) that would get info from the db and display it but when I point my browser to http://localhost:8080/helloworld.jsp, I get ClassNotFound exception.
<html>
<head>
<title>My first JSP page
</title>
</head>
<body>
<%@page import="java.sql.*" %>
<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url = "jdbc:mysql:///" + "trylnp";
String user = "root";
String pass = "welcome";
Connection conn = DriverManager.getConnection(url,user,pass);
out.println("here");
if((conn != null)&&(!conn.isClosed()))
{
out.println("Connected...");
}
String releasenum="3.1.48A";
String query = "Select * from releasedata where releaseno='" + releasenum + "'; ";
Statement s = conn.createStatement();
ResultSet rs = s.executeQuery(query);
while(rs.next())
{
String useraction = rs.getString("useraction");
String releaseno = rs.getString("releaseno");
int ninetyfivepercentile = rs.getInt("ninetyfivepercentile");
int ninetypercentile = rs.getInt("ninetypercentile");
int fiftypercentile = rs.getInt("fiftypercentile");
out.println("useraction : ");
out.println("releaseno : ");
out.println("ninetyfivepercentile : ");
out.println("ninetypercentile : ");
out.println("fiftypercentile : ");
}
}
catch(Exception e ){
out.println(e);
}
%>
</body>
</html>
I've properly set my classpath to C:\Program Files\mysql-connector-java-5.1.6\mysql-connector-java-5.1.6-bin.jar
and also put the jar file in all the WEB-INF sub folders inside C:\apache-tomcat-6.0.16\webapps (I know it had to go in one of the WEB-INF dir, but as I was not sure which one, I put the jar file in all of the WEB-INF folders)
Please, do let me know if u know how to resolve the issue. It'll be a big help.
Thanks.