Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDBC Connections with mySQL and Interbase will not work correctly

843854Dec 31 2002 — edited Jan 5 2003
First the System and the JDK/JREs

System :AMD XP1800
RAM :512 DDR
OS :Suse Linux 8.1
Java JDK/JRE (Default) J2SDK 1.3.1_06


These problems are very strange and I think they "may be related" to Unix sockets.

(1) Problem 1 : I can connect fine to a MYSQL server using the mysql-connector-java-2.0.14 drivers on localhost, but I cannot connect to any remote server with the JDBC drivers. I can connect using the mySQL client to any of my servers.

The stack trace is per below:

java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:172)
at com.borland.dx.sql.dataset.Database.openConnection(Unknown Source)
at com.borland.jdbcx.metadata.DatabaseInfo.openConnection(Unknown Source)
at com.borland.jdbcx.metadata.e.run(Unknown Source)

The drivers are on the classpath. Of course connecting via localhost works fine.


(2) Interbase Interclient drivers (tried both drivers Firebird Interclient.2.01, and Borland's 2.51)

Here I get the opposite effect. I can connect fine to any of my database servers running Firebird 1.0, but I cannot connect to the localhost. Here the message is "Connection refused."

Stack trace is

Chained exception:
interbase.interclient.CommunicationException: [interclient] Communication error: A socket exception occurred while trying to establish a socket connection to server localhost.
The message of the SocketException is "Connection refused".
See API reference for exception interbase.interclient.CommunicationException
at interbase.interclient.JDBCNet.establishSocketStreams(Unknown Source)
at interbase.interclient.JDBCNet.<init>(Unknown Source)
at interbase.interclient.Connection.connect(Unknown Source)
at interbase.interclient.Connection.<init>(Unknown Source)
at interbase.interclient.Driver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:172)
at com.borland.dx.sql.dataset.Database.openConnection(Unknown Source)
at com.borland.jdbcx.metadata.DatabaseInfo.openConnection(Unknown Source)
at com.borland.jdbcx.metadata.e.run(Unknown Source)



Solutions tried:

First we modified the services file for Interclient according to documentation.
Modified the initd.conf file as per docs as well. Ran the default services scripts and tried writing our own. No luck.

On mySQL, we set all permissions and can connect fine either locally or remotely using the mysql client.

Next we tried setting the IPTables to include/open the needed ports. No luck, same results.

Second we uninstalled the IPTables and the Firewall and tried running naked. Still, the same results.

We are at a loss and would appreciate your assistance. We have had both of these working before, before we did a reinstall.

The only thing that has changed is that we are now running Lin4Win.


Your assistance greatly appreciated
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2003
Added on Dec 31 2002
3 comments
340 views