Linux下用SQL Server??? 第一次听说。
呵呵,还是给你一个看看吧:
package myprojects.linkmssserver;
import java.io.*;
import java.sql.*;
import oracle.jdbc.driver.*;
import oracle.sql.*;
import java.util.Enumeration;
import java.util.Hashtable;
public class Linkmssserver {
public static Connection con = null;
public static void main(String args[]) {
try {
DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433", "sa", "78297730");
System.out.println("连接成功!");
} catch (SQLException e) {
System.out.println("error in retrieve data from news");
}
}
}