Wednesday, January 30, 2008

java.sql.SQLException: The application requester cannot establish the connection

Scenario
If you get the following exception when you try to establish a connection to the MachineName.Please check if you can ping the MachineName from the current machine.The most probable issue would be, that the domain name is not proparly resolved.
Exception Stack
java.sql.SQLException: The application requester cannot establish the connection.(MachineName) at com.ibm.as400.access.JDError.throwSQLException(JDError.java:336) at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:1988) at com.ibm.as400.access.AS400JDBCDriver.prepareConnection(AS400JDBCDriver.java:752) at com.ibm.as400.access.AS400JDBCDriver.initializeConnection(AS400JDBCDriver.java:642) at com.ibm.as400.access.AS400JDBCDriver.connect(AS400JDBCDriver.java:232) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:140)
Solution
Make sure your current machine can resolve the MachineName to MachineName with the proper domain.
There could be several reasons behind the failure in establishing a connection.Most of the time '
java.sql.SQLException: The application requester cannot establish the connection' will be followed by a reason,like:
1]
Not able to pass connection to server
2]
Connection refused: connect
3]
Operation timed out: connect
4]
No route to host: connect
5]
A remote host refused an attempted connect operation
6]Timeout etc etc.,
But if the connection is not established, and the exception just displays the MachineName, then you might need to check if that machine can be accessed by pinging that machine or writing asample JDBC program that establishes a connection to that server.etc.,
Related Adding DNS Suffixes

No comments: