I am trying to migrate my application from tomcat/windows to Tomcat/Linux, but I've got a problem with my JDBC connection.
I've got the same code and the same configuration of tomcat on my two machines, but while the JDBC connection is ok under Windows, i got this error message on linux:
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection.
I can do a telnet on the database machine with the good port:
telnet 192.168.1.190 1521
it works on windows and on linux.
Iva tried two ways to write my jdbc url:
but the two ways don't work...
Try using a host name -- and not an IP address. Make sure you can access the Oracle database server host machine -- from your client machine -- using the host name (instead of the IP address).
I've got the same problem with Oracle XE and Windows XP. The connection works from the computer running the database, but it gives me this error when working from a different computer. Neither IP nor hostname work :(
The Network Adapter exception is caused because:
1. The database host name or port number is wrong.
2. The database TNSListener has not been started. The TNSListener may be started with the lsnrctl utility.
Actually, if the database connection URL is incorrect, the "Network Adapter" error message is received. The database connection URL includes, host name, listener port and instance name. Hence you can get this error also if the instance name is wrong -- not just the host name and port number.
Just wanted to help make your (excellent) answer more complete :-)