环境变量配置:
classpath=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;C:\Tomcat 6.0\lib\servlet-api.jar;

JAVA_HOME=C:\java\jdk1.6.0_10

path=%JAVA_HOME%\bin;C:\Program Files\PC Connectivity Solution\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN

CATALINA_BASE=C:\Tomcat 6.0

CATALINA_HOME=C:\Tomcat 6.0

测试检测:安装jdk1.6之后配置环境变量安装了tomcat6.0 启动后输入http://localhost:8080/后出现tomcat页面,继续进行做了个Today.jsp放入C:\Tomcat 6.0\webapps\ROOT下出现正常的时间显示页面,Today.jsp如下代码:
<html>
<head>
<title>First Page</title>
</head>
<body>

Today is:
<%= new java.util.Date() %>

</body>
</html>.显示页面Today is: Sun May 01 21:27:52 CST 2011 .
然后进行sql安装:1.安装sql2000
2.打上补丁sp4(解压后执行setup.bat)
3. 安装jdbc驱动包
4.将驱动包中的msbase.jar、mssqlserver.jar、msutil.jar复制到C:\Tomcat 6.0\lib
5.将jar路径加入classpath,最后的环境变量如上面所示、
6.新建数据库DatabaseName=pxjgjw及students表,账户sa密码123.开启mssql服务器开启tomcat服务
打开分析器输入select @@version获得信息如下
Microsoft SQL Server  2000 - 8.00.2039 (Intel X86)   May  3 2005 23:18:38   Copyright (c) 1988-2003 Microsoft Corporation  Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 3) 应该是sp4版本的。

7.java与sql2000也连接上了连接代码如下:
import java.sql.*;
public class Test2
{
public static void main(String[] args)
{
           String sql;
           Connection conn;
           Statement stmt;
           ResultSet rs;
    try
    {
            Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
            String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pxjgjw";
            String user="sa"; 
            String password="123"; 
            conn= DriverManager.getConnection(url,user,password);  
            stmt=conn.createStatement();  
            sql="select * from students";  
            rs=stmt.executeQuery(sql); 
            while(rs.next())
            {
                   System.out.println(rs.getString(1));
                   System.out.println(rs.getString(2));
            }
            rs.close();
            stmt.close();
            conn.close();
    }
    catch(Exception e)
    {
     e.printStackTrace(); 
    }
}
}
8.cmd netstat -an检测1433端口状态: LISTENING        8080端口状态: LISTENING另外防火墙一直都是关闭的。
9.编写jsp检测jsp与sql2000的链接,脚本Testsqlserver.jsp如下:
<%@ page contentType="text/html;charset=gb2312"%> 
<%@ page import="java.sql.*"%> 
<html> 
<body> 
<%Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance(); 
String url="jdbc:microsoft: sqlserver://localhost:1433;DatabaseName=pxjgjw"; 
//pxjgjw为数据库名
String user="sa"; 
String password="123"; 
Connection conn= DriverManager.getConnection(url,user,password); 
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); 
String sql="select * from students"; 
ResultSet rs=stmt.executeQuery(sql); 
while(rs.next()) {%> 
您的第一个字段内容为:<%=rs.getString(1)%> 
您的第二个字段内容为:<%=rs.getString(2)%> 
<%}%> 
<%out.print("数据库操作成功,恭喜你");%> 
<%rs.close(); 
stmt.close(); 
conn.close(); 
%> 
</body> 
</html>.

但却出现500错误:
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: An exception occurred processing JSP page /Testsqlserver.jsp at line 10

7: //pubs为你的数据库的 
8: String user="sa"; 
9: String password="123"; 
10: Connection conn= DriverManager.getConnection(url,user,password); 
11: Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); 
12: String sql="select * from students"; 
13: ResultSet rs=stmt.executeQuery(sql); 


Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:519)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:410)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause 

javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc:microsoft: sqlserver://localhost:1433;DatabaseName=pxjgjw
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
    org.apache.jsp.Testsqlserver_jsp._jspService(Testsqlserver_jsp.java:97)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause 

java.sql.SQLException: No suitable driver found for jdbc:microsoft: sqlserver://localhost:1433;DatabaseName=pxjgjw
    java.sql.DriverManager.getConnection(Unknown Source)
    java.sql.DriverManager.getConnection(Unknown Source)
    org.apache.jsp.Testsqlserver_jsp._jspService(Testsqlserver_jsp.java:63)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)[/size][/size][/size]