<%@ page language="java" contentType="text/html; charset=gbk"
pageEncoding="gbk"%>
<%@ page import="java.sql.*"%>
<%
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
Statement stmtCount= conn1.createStatement();
ResultSet rsCount =stmtCount.executeQuery("select count(*) from dingdan");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:firstdb";
conn = DriverManager.getConnection(url,"admin3","admin3");
stmt=conn.createStatement();
String sql="SELECT Top "+pageSize+" * FROM dingdan WHERE Id not in (select top "+startPos+" Id From dingdan Order By ID)Order By ID";
rs=stmt.executeQuery(sql);
while(rs.next()){
.............................................................
}
rs.close();
stmt.close();
conn.close();
%>
这是我的部分代码,运行后是"500错误",java.lang.NullPointerException
当我把stmtCount和rsCount删除后页面就能正常的显示了,我觉得是不是我用的驱动的问题.大家帮帮忙