title: MY JDBC program compiles successfully but does not runs with exception
body: <p>My Program runs successfully but gives an exception at the runtime.
  I have followed all the 8 steps to make a JDBC program.
  The code and image showing the exception are given.
  I have also created my own DSN(data source name) in the admin settings in my control panel.
  Anyone who would let me know a solution to this problem. 
  I would be highly grateful to you.
  Thanks in advance.</p>
  
  <blockquote>
    <p>This shows the error which I face at the run time</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/tbRYS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tbRYS.jpg" alt="enter image description here"></a></p>
  
  <pre><code>import java.sql.*;
  
  public class JDBC {
  
      public static void main(String[] args) 
      { 
          try
          {
              // TODO Auto-generated method stb
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
              String conURL = "jdbc:odbc:PersonDSN" ;
              Connection con = DriverManager.getConnection(conURL) ;
              Statement st = con.createStatement() ;
  
              String sql = "Select * from Student" ;
              ResultSet rs  = st.executeQuery(sql) ;
              while (rs.next())
              {
                  String sname = rs.getString("SName");
                  String saddress = rs.getString("SAddress");
                  String sno = rs.getString("SNumber");                   
                  System.out.println(sname + "   " + saddress + "   " + sno );                     
              }
  
              con.close();
  
          }
          catch (Exception a)
          {
              System.out.print(a);
  
          }
      }
  }
  </code></pre>