title: Unable to connect to database using jsp in ubuntu
body: <p>I am trying to connect with the mysql database in linux. I know I am making mistake in including the jar file. I don't know how to give reference to those jar files in linux the way we reference them in eclipse or Netbeans. I am running those jsp pages using tomat7.</p>
  
  <p>type Exception report</p>
  
  <p>message An exception occurred processing JSP page /first.jsp at line 9</p>
  
  <p>description The server encountered an internal error that prevented it from fulfilling this request.</p>
  
  <p>exception</p>
  
  <p>org.apache.jasper.JasperException: An exception occurred processing JSP page /first.jsp at line 9</p>
  
  <p>6:  &lt;%
  7:<br>
  8:  out.println("Hello World!");
  9:  Class.forName("com.mysql.jdbc.Driver");
  10:     Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/MeshliumDB","myuser","mypass");
  11:     if(con!=null)
  12:         out.println("Connection Established");</p>
  
  <p>Stacktrace:
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:727)</p>
  
  <p>root cause</p>
  
  <p>javax.servlet.ServletException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)
      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)
      org.apache.jsp.first_jsp._jspService(first_jsp.java:86)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:727)</p>
  
  <p>root cause</p>
  
  <p>java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:126)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
      java.lang.Class.forName0(Native Method)
      java.lang.Class.forName(Class.java:191)
      org.apache.jsp.first_jsp._jspService(first_jsp.java:73)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:727)</p>