title: Error -java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
body: <p>I want to connect to database in java web application.I wrote this code in servlet and i add related jar file(ojdbc) but when i run it,it gives me this error:
  java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver</p>
  
  <pre><code>public class DBConnection extends HttpServlet {
      private static final long serialVersionUID = 1L;
  
      /**
       * @see HttpServlet#HttpServlet()
       */
      public DBConnection() {
          super();
          // TODO Auto-generated constructor stub
      }
  
      public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
  
          Connection con = null;  
  
          try {
              Class.forName("oracle.jdbc.driver.OracleDriver");
                con = DriverManager.getConnection("jdbc:oracle:thin:@192.168.101.84:1521:orcl","XXXX","XXXX");
                if(con!=null)
                   System. out.println("Connection Successful");
                else
                    System.  out.println("error");
  
          }
          catch (Exception e) {
              //System.out.println(e);
          }
  ...
  </code></pre>
  
  <p>what should i do?</p>