facebook

3.8 and jdbc [Closed]

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #212196 Reply

    arnor
    Member

    Hi to all,

    I have installed 3.8 on my suse 9.1 with sun 1.4.2 vm and I exploring it
    my first nice problem:
    When I try a jdbc connection with Mysql driver I get this exception:
    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 Aug 17, 2004 10:38:07.172
    !MESSAGE Error logging to database
    !STACK 0
    java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused

    ** BEGIN NESTED EXCEPTION **

    java.net.ConnectException
    MESSAGE: Connection refused

    STACKTRACE:

    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at java.net.Socket.<init>(Socket.java:309)
    at java.net.Socket.<init>(Socket.java:124)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:121)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:220)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:1768)
    at com.mysql.jdbc.Connection.<init>(Connection.java:440)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400)
    at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:99)
    at com.genuitec.eclipse.sqlexplorer.LoggingProgress.run(Unknown Source)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)

    ** END NESTED EXCEPTION **

    at com.mysql.jdbc.Connection.createNewIO(Connection.java:1836)
    at com.mysql.jdbc.Connection.<init>(Connection.java:440)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400)
    at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:99)
    at com.genuitec.eclipse.sqlexplorer.LoggingProgress.run(Unknown Source)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)

    I can connect to mysql with apache/php (phpMyAdmin) and also with java datasource (jrun4).
    Any Idea?

    tks in advance

    Lorenzo

    #212250 Reply

    Riyad Kalla
    Member

    Is your connection string correct? Are you using the same account to connect that those other resources use? What version of COnnector/J are you using? What version is the DBMS?

    #212523 Reply

    arnor
    Member

    my connection setting in myeclipse:
    jdbc:mysql://localhost:3306/croxit
    user:root
    pswd:

    in jrun-resource.xml
    <data-source>
    <dbname>ds_croxit</dbname>
    <driver>org.gjt.mm.mysql.Driver</driver>
    <url>jdbc:mysql://127.0.0.1:3306/croxit</url>
    <username>root</username>
    <password />

    I use mysql-connector-java-3.0.14-production-bin
    the dbms is mysql MySQL 4.0.18-Max

    Regards Lorenzo.

    ps. I go in holiday today for a week. More feedback next week ^_^

    #212556 Reply

    Riyad Kalla
    Member

    Lorenzo,
    I noticed that the nested exception is a NewIO problem creating the connection, in the README for the driver they have a list of the arguments the drive can take, one of them can disable using Java 1.4s NIO library, try and disable that and see if it connects. If it doesn’t and you still get a connection refused, then there is likely something wrong with your local setup or permissions.

    #213393 Reply

    arnor
    Member

    I solved the problem.
    I have changed “localhost” with 127.0.0.1

    very strange because “ping localhost” it work fine

    Regards Lorenzo

    #213422 Reply

    Riyad Kalla
    Member

    That is a odd one… I’m glad you figured it out and thanks for posting back here for other users.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: 3.8 and jdbc [Closed]

You must be logged in to post in the forum log in