facebook

[Closed]problem setting up new database connection

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

    smoyer
    Member

    I am trying to set up a new database connection with the Driver Manager. I am setting these values:

    Driver name: MySQL Connector/J Driver
    Connection URL: jdbc:mysql://127.0.0.1:3306/test
    Driver JARs: C:\mysql-connector-java-3.1.12.zip
    Driver class name: com.mysql.jdbc.Driver

    The ok button is grayed out and there is a message Driver class not found. What am I doing wrong?

    #246183 Reply

    Haris Peco
    Member

    you grab worng driver from anywhere, probably (or database setup is wrong)
    try application from this thread

    http://myeclipseide.com/PNphpBB2+file-viewtopic-t-11228.html

    (message from snpe)

    #246186 Reply

    smoyer
    Member

    When I run the program. I am getting the same problems, but I still don’t know what to do.

    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at mySource.MyMain.main(MyMain.java:14)

    #246187 Reply

    Haris Peco
    Member

    if you work with eclipse add mysql jdbc jar in classpath

    #246189 Reply

    smoyer
    Member

    I’m not sure how to do it.

    #246190 Reply

    Haris Peco
    Member

    right click on project – choose properties – Build Path and in library tab add exetrnal jar – show to your jdbc jar

    you have to add jdbc jar when make MyEclipse connection, too

    #246191 Reply

    smoyer
    Member

    Thank you. I think that I have it now.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: [Closed]problem setting up new database connection

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