求救!JSP无法连接数据库
<%@ page contentType= "text/html;charset=gb2312 "%>
<%@ page import= "java.sql.* "%>
<HTML>
<BODY>
<% Connection con;
Statement sql;
ResultSet rs;
try{
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver ");
}
catch(
ClassNotFoundException e){}
try {con=DriverManager.getConnection( "jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=pubs ", "sa ", "sa ");
sql=con.createStatement();
rs=sql.executeQuery( "SELECT * FROM students ");
out.print( " <Table Border> ");
out.print( " <TR> ");
out.print( " <TH width=100> "+ "学号 ");
out.print( " <TH width=100> "+ "姓名 ");
out.print( " <TH width=100> "+ "数学成绩 ");
out.print( " <TH width=100> "+ "英语成绩 ");
out.print( " <TH width=100> "+ "物理成绩 ");
out.print( " </TR> ");
while(rs.next())
{ out.print( " <TR> ");
out.print( " <TD > "+rs.getString(1)+ " </TD> ");
out.print( " <TD > "+rs.getString(2)+ " </TD> ");
out.print( " <TD > "+rs.getInt( "数学成绩 ")+ " </TD> ");
out.print( " <TD > "+rs.getInt( "英语成绩 ")+ " </TD> ");
out.print( " <TD > "+rs.getInt( "物理成绩 ")+ " </TD> ");
out.print( " </TR> ") ;
}
&nb