facebook

Problems creating a database connection to MySQL

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #280386 Reply

    MikeKing
    Member

    My Database Connection Driver edit window in DB Explorer contains:
    **************************************************************************************
    Driver Template: MySQL Connector/J
    Driver Name: esdmf_development_MySQL_ConnectorJ
    Connection URL: jdbc:mysql://localhost/esdmf_development
    User Name: root
    Password:
    DriverJars: … mysql-connector-java-2.0.14-bin.jar
    Driver Class Name: com.mysql.jdbc.Driver

    When I ‘Test Driver’, the following error is reported:
    **************************************************************************************

    Error while performing database login with the
    esdmf_development_MySQL_ConnectorJ driver:
    Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to conntect to?
    (java.lang.NumberFormatException)

    I then use a Windows command prompt screen to enter the following MySQL commands,
    which seem to indicate that there is a MySQL server running and that the database connection strings are correct!
    **************************************************************************************

    C:\Program Files\EasyPHP 2.0b1\mysql>cd bin

    C:\Program Files\EasyPHP 2.0b1\mysql\bin>mysql -h localhost -u root
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 5 to server version: 5.0.27-community-log

    Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

    mysql> show databases
    -> ;
    +——————–+
    | Database |
    +——————–+
    | information_schema |
    | ac_development |
    | esdmf_development |
    | iso11179 |
    | moodle |
    | mysql |
    | qf_development |
    | statssa |
    | test |
    +——————–+
    9 rows in set (0.18 sec)

    mysql> use esdmf_development
    Database changed

    mysql> show tables;
    +—————————–+
    | Tables_in_esdmf_development |
    +—————————–+
    | administereditemcomment |
    | administereditemowner |
    | administereditemrecord |
    | adminitemevent |
    | authority |
    | conceptualdomain |
    | context |
    | dataelement |
    | dataelementconcept |
    | enumeratedvaluedomain |
    | nonenumeratedvaluedomain |
    | objectclass |
    | permissablevalue |
    | property |
    | role |
    | testcompassindexing |
    | unitofmeasure |
    | user |
    | valuedomain |
    | valuedomainpermissablevalue |
    +—————————–+
    20 rows in set (0.00 sec)

    mysql> select * from dataelement;
    Empty set (0.25 sec)

    mysql> describe dataelement;
    +———————-+————–+——+—–+———+—————-+
    | Field | Type | Null | Key | Default | Extra |
    +———————-+————–+——+—–+———+—————-+
    | id | bigint(20) | NO | PRI | NULL | auto_increment |

    | optLock | int(11) | YES | | NULL | |

    | name | varchar(255) | NO | UNI | | |

    | dataElementConceptId | bigint(20) | YES | MUL | NULL | |

    | valueDomainId | bigint(20) | YES | MUL | NULL | |

    +———————-+————–+——+—–+———+—————-+
    5 rows in set (0.10 sec)

    mysql> status
    ————–
    mysql Ver 14.12 Distrib 5.0.27, for Win32 (ia32)

    Connection id: 5
    Current database: esdmf_development
    Current user: root@localhost
    SSL: Not in use
    Using delimiter: ;
    Server version: 5.0.27-community-log
    Protocol version: 10
    Connection: localhost via TCP/IP
    Server characterset: latin1
    Db characterset: latin1
    Client characterset: latin1
    Conn. characterset: latin1
    TCP port: 3306
    Uptime: 20 hours 50 min 50 sec

    Threads: 1 Questions: 55 Slow queries: 0 Opens: 13 Flush tables: 1 Open tab
    les: 1 Queries per second avg: 0.001
    ————–

    mysql>

    **************************************************************************************
    Please can someone assist me. What have I done wrong? What can I do to discover and understand the problem? In particular, take note of the ‘mysql> status’ command response immediately above this text.

    The MySQL databases are in the directory called
    C:\Program Files\EasyPHP 2.0b1\mysql\data but I have assumed that this directory path is not needed in the database connection strings.

    As you can see, MySQL was installed as part of EasyPHP 2.0b1, however I am trying to create MyEclipse Java programs to access it without using PHP at all.
    ***********************************************

    The report below is from MyEclipse Installation Details
    **************************************************************

    *** Date:
    Tuesday, January 8, 2008 1:35:22 PM CAT

    ** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_11

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 6.0.1 GA
    Build id: 6.0.1-GA-200710

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 6.0.1 GA
    Build id: 6.0.1-GA-200710

    Eclipse Platform

    Version: 3.3.1.R33x_r20070911-_19UEkpF-B7Uh2hKy75y
    Build id: M20070921-1145

    Eclipse RCP

    Version: 3.3.1.R33x_r20070802-8y8eE8sEV3Fz0z0GlHJrXvTAUS
    Build id: M20070921-1145

    Eclipse Java Development Tools

    Version: 3.3.1.r331_v20070629-7o7jE72EDlXAbqAcnbmyg1rf8RIL
    Build id: M20070921-1145

    Eclipse Plug-in Development Environment

    Version: 3.3.1.R33x_r20070802-7N7M3D1VIA_52JsDFsEC
    Build id: M20070921-1145

    Eclipse Project SDK

    Version: 3.3.1.R33x_r20070802-7M7J78_mu1mnlRa7A4Ns52XeZ6D0
    Build id: M20070921-1145

    Eclipse Graphical Editing Framework

    Version: 3.3.1.v20070814
    Build id: 20070814-1555

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -showsplash
    -launcher
    C:\Program Files\MyEclipse 6.0.1\eclipse\eclipse.exe
    -name
    Eclipse
    –launcher.library
    C:\Program Files\MyEclipse

    6.0.1\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.1.R33x_v20070828\eclipse_1020.dll
    -startup
    C:\Program Files\MyEclipse 6.0.1\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar
    -exitdata
    ab4_74
    -vm
    C:\Program Files\MyEclipse 6.0.1\jre\bin\javaw.exe

    #280410 Reply

    Loyal Water
    Member

    Can you download a newer version of the driver and try it out. The “Test Driver” funcationality should not return any errors.

    #280515 Reply

    MikeKing
    Member

    @support-nipun wrote:

    Can you download a newer version of the driver and try it out. The “Test Driver” funcationality should not return any errors.

    Nipun,
    Thanks for the help. I downloaded the latest version driver. The test then worked.

    Thanks,
    Mike King

    #280521 Reply

    Loyal Water
    Member

    Your Welcome.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Problems creating a database connection to MySQL

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