私はMS SQLデータベースに接続するJavaプログラムを持っています。プログラムの動作日食を通じて実行しているとき、私はAIXを通してそれを実行するとは完全には、しかし、私はエラーを取得する:telnetで外部データベースに接続
ます。java.sql.SQLException:ネットワークエラーにIOException:リモートホストが試み接続操作を拒否しました。
サーバにpingできますが、サーバにtelnetで接続できません。私はまた、私のWindowsデスクトップからtelnetすることができません。
私は接続するために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){}
は問題に関してのjTDSからいくつかのドキュメントがあるが、私はまだ問題を解決することはできませんよ。
Why do I get java.sql.SQLException: "Network error IOException: Connection refused: connect" when trying to get a connection?
The "Connection refused" exception is thrown by jTDS when it is unable to connect to the server. There may be a number of reasons why this could happen:
- The server name is misspelled or the port number is incorrect.
- SQL Server is not configured to use TCP/IP. Either enable TCP/IP from SQL Server's Network Utility app or have jTDS connect via named pipes (see the URL format for information on how to do this).
- There is a firewall blocking port 1433 on the server.
To check whether TCP/IP is enabled and the port is not blocked you can use "telnet 1433". Until telnet doesn't connect, jTDS won't either. If you can't figure out why, ask your network administrator for help.
あなたは「私は成功し、サーバをpingが、サーバにtelnetすることはできませんよできるとはどういう意味ですか私もからtelnetで接続することはできませんよ。 telnetがインストールされていないか、そのtelnetを使用する権限がないか、telnetを試みても何も起こらないということですか? – Hoons
Telnetはこれとは関係ありません。 Telnet経由でデータベースに接続していません。あなたのデータベースサーバーはあなたのアプリからのSQL Serverポート(1433)での接続を許可していません。これはおそらくネットワーク構成やファイアウォール構成の問題であり、ソフトウェアの問題ではありません。 – Joe