Post date: Jan 12, 2013 12:41:07 AM
I recently ran into a networking "issue" that was causing my JDBC data queries to not connect to their servers.
java.sql.SQLException: The Network Adapter could not establish the connection
This came out of (what I thought was) no-where because the commandline app previously worked fine.I was running an SQL based commandline app that was accessing an Oracle database.SERVER=DEDICATED
on the JDBC connection Nothing worked, until... I backed out my JDK7 install and tried running it with Java 6.It worked again!I did a bit more digging and found someone else with a similar network problem related to IP6
that got fixed by adding
-Djava.net.preferIPv4Stack=true
to the commandline, so I went back to Java7, added that define to my commandline and
After reading the Oracle Java docs on this subject - http://docs.oracle.com/javase/6/docs/technotes/guides/net/ipv6_guide/index.html
I think this is actually a Windoze 7 thing, because Java transparently uses what is given to in the underlying system. My code has no specific requests for IP6 or IP4 for that matter.