首先设置odbc数据源:在系统dsn中加入数据源
在jsp中书写如下:
      try
        { 
     Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
     }
       catch (ClassNotFoundException e)
        { 
     System.out.println( "SQLException:"+e.getMessage());
    }
      try
        {
         Connection con=DriverManager.getConnection( "jdbc:odbc:你的数据源中的名字);
         Statement stmt=con.createStatement();
         ResultSet rs = stmt.executeQuery("select * from 表名");