2 Replies - 1492 Views - Last Post: 30 May 2010 - 04:49 AM Rate Topic: -----

#1 gda2004   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 111
  • Joined: 08-January 09

JDBC and mysql ?

Posted 30 May 2010 - 04:17 AM

Basically I am looking to connect to my database through java I can login find through MySQL Administrator. I Would would like to know how to check to see if the drivers are in the right place to perform the connection ? I am also on a fedora box
This is the exception I am getting
jdbc:mysql:3306//localhost/dsdjava.lang.ClassNotFoundException: com.mysql.jdbc.Driver


Class.forName("com.mysql.jdbc.Driver").newInstance();

DBconnection = new DatabaseC("jdbc:mysql:3306//localhost/dsd", UserID, Password);


this is the output from telnet however :
[[email protected] ~]$ telnet localhost 3306
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
4
5.1.46^tNhBNCfYj*/Lrw#Cf[]

Got packets out of orderConnection closed by foreign host.

I presumed that the telnet did not work because it did not have a user name and password but I thought I would post it just in case.

Thanks,

Gda2004

Is This A Good Question/Topic? 0
  • +

Replies To: JDBC and mysql ?

#2 Matteo1988   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 16
  • Joined: 11-February 10

Re: JDBC and mysql ?

Posted 30 May 2010 - 04:27 AM

Maybe you should add jar with mysql-connector to your project?
Was This Post Helpful? 0
  • +
  • -

#3 gda2004   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 111
  • Joined: 08-January 09

Re: JDBC and mysql ?

Posted 30 May 2010 - 04:49 AM

thanks for the quick response I added the jar file took the 3306 out and it connects happy days :) for anyone unsure on how to add Jar files under eclipse go to http://www.wikihow.c...ipse-%28Java%29 it helped me
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1