Hi all,
I am developing some application on Linux machine where I need to establish database connection using mysql driver. I have written following code for that.
------------PROGRAM--------------------------------------------------------------------------------------------------
<%@ page import="java.sql.*" %>
<%@ page language="java" %>
<html>
<head>
<title> Doctor's Work Bench </title>
</head>
<body>
<center><h1> Welcome to Immunization Page </h1><br><br>
<%
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
;
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","","");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select IMMUNISATION_NAME from IMMUNISATION_REF_T");
while(rs.next())
{
String str=rs.getString("IMMUNISATION_NAME");
%>
<textarea rows="25" cols="20"> <%=str%> </textarea></center>
<% }
}
catch(Exception e)
{
out.println("Some Error has occoured"+e);
e.printStackTrace();
}
%>
</body>
</html>
-------------------------------------- END PROGRAM--------------------------------------------------------------------------------------------------
but when I execute the same in the browser it is giving following exception in the browser==>
ClassNotFoundException: com.mysql.jdbc.Driver
Can anyone help me to solve this problem.
Thanks & Regards,
Abhijit