我有一个连接到 MS SQL 数据库的 java 程序。该程序在通过 Eclipse 运行时运行良好,但是当我通过 AIX 运行它时出现错误:
java.sql.SQLException:网络错误 IOException:远程主机拒绝了尝试的连接操作。
我正在使用 jtds 连接:
String connectionString = "jdbc:jtds:sqlserver://"+dropez_ip_address+"/"+dropez_db_name;
ResultSet rs = null;
Statement stmt = null;
try{
Class.forName("net.sourceforge.jtds.jdbc.Driver");
Connection conn = DriverManager.getConnection(connectionString, dropez_db_username, dropez_db_password);
stmt = conn.createStatement();
}catch(Exception e){}