<%@ include file="classpath.jsp"%>
<%@ page import="java.sql.*"%>
<%
try{        String url = "jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=TestDB" ;
        Connection conn = null ;
        String userID = "sa" ;
        String userPWD = "" ;
        java.sql.Statement stmt = null;
        
try{
DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
conn=DriverManager.getConnection(url,userID,userPWD);
   stmt=con.createStatement();//差这一句
          stmt.execute("SELECT * FROM Table");
          conn.close();
       }
catch(SQLException e)
{
         System.out.println("mytest sqlserver !");
while (e!=null)
{ System.out.println("SQLState:"+e.getSQLState());
System.out.println("Message :"+e.getMessage());
System.out.println("Vendor  :"+e.getErrorCode());
e=e.getNextException();
System.out.println(" ");
}
conn=null;
}
}
finally
{

}%>