源代码:
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<%@ page import="java.sql.*" %>
<html><body>
"连接数据库<br/>
<%
String driverClass="com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url= "jdbc:sqlserver://localhost:1433;DatabaseName=db_database08";
String username="sa";
String password="sa";
Connection conn;
Class.forName(driverClass);
conn=DriverManager.getConnection(url,username,password);
%>
</body></html>
错误信息:
HTTP Status 500 -type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception javax.servlet.ServletException: java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
root cause java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
note The full stack traces of the exception and its root causes are available in the GlassFish v3 logs.
GlassFish v3
如何解决