import java.sql.Connection;
import java.sql.DriverManager;
import com.microsoft.sqlserver.jdbc.*;
public class link {
public static void main(String args[]){
String DriverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";

String DBUrl = "jdbc:sqlserver://ADMIN-WIN7-PC\\agronet08:1433;databaseName=Login;integratedSecurity=true;";  try{
Class.forName(DriverName);
System.out.println("驱动注册成功!");
}catch(Exception e){
System.out.println("Excetption :" + e.getMessage());
}
Connection con = null;
try{
con = DriverManager.getConnection(DBUrl);

System.out.println("数据库连接成功!");
}catch(Exception ex){
System.out.println("Exception ex:" + ex.getMessage());;
}

}
}出现的异常:
驱动注册成功!
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.microsoft.sqlserver.jdbc.AuthenticationJNI.GetDNSName(Ljava/lang/String;[Ljava/lang/String;Ljava/util/logging/Logger;)I
at com.microsoft.sqlserver.jdbc.AuthenticationJNI.GetDNSName(Native Method)
at com.microsoft.sqlserver.jdbc.AuthenticationJNI.GetDNSName(AuthenticationJNI.java:83)
at com.microsoft.sqlserver.jdbc.AuthenticationJNI.InitDNSNameAndPort(AuthenticationJNI.java:76)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2322)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:1905)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:1893)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1045)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at link.main(link.java:20)