title: Unable to connect my jsp page with ms access
body: <p>I could not connect my jsp page with ms access
  it says </p>
  
  <pre><code>"java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
  </code></pre>
  
  <p>I have created a dsn but still the problem is same..</p>
  
  <p>I searched the net extensively but couldn't rectify.... </p>
  
  <pre><code>DriverManager.getConnection("jdbc:odbc:students");
  </code></pre>
  
  <p>This line is causing exception.... 
  I selected the data source in the DNS still too.... I'm using Access....</p>
  
  <p>Here is everything:</p>
  
  <pre><code>&lt;%@page import="java.sql.PreparedStatement"%&gt;
  &lt;%@page import="java.sql.DriverManager"%&gt;
  &lt;%@page import="java.sql.Connection"%&gt;
  &lt;%@page contentType="text/html" pageEncoding="UTF-8" language="java"%&gt;
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;JSP Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;%
  
  PreparedStatement pstm;
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  
  //connection object created using DriverManager class
  //employee is the name of the database
  Connection connect =DriverManager.getConnection("jdbc:odbc:employee");
  
  //creating prepared statement object pstm so that query can be sent to database
  pstm=connect.prepareStatement("insert into employee values(?,?,?,?)");
  pstm.setString(1,"5");
  pstm.setString(2,"parth");
  pstm.setString(3,"parth");
  pstm.setString(4,"10000");
  //execute method to execute the query
  pstm.executeUpdate();
  out.println("Record Added Successfully");
  pstm.close();
  
  connect.close();
  %&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>