ネットワーク上のマシンで SQL データベースに接続しようとしています。TCP/IP 設定とファイアウォール設定はすべて正しく接続できることがわかりますが、接続文字列に問題があります。
コード:
static String dbUser = "user";
static String dbPass = "pass";
static String dbURL = "jdbc:sqlserver://SERVER1/BKUPEXEC;Instance=SQL2005;databaseName=images;";
static String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
try {
Class.forName(driverName).newInstance();
con = DriverManager.getConnection(dbURL, dbUser, dbPass);
System.out.println("Connected with host:port/database.");
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | SQLException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
エラー:
SEVERE: null
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host TMTSERVER1, port 1433 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".