• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connnecting Java programs to Mysql

 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I have had this problem for a while now! I have the native drivers downloaded i just dont seem to know how to do the connection! I place the uncompressed file in my classpath as instructed in the README, it just doesnt seem to work! I use the Connect.java that came with a sample of the connector driver and it doesnt seem to work! Pls someone should help me out and point me in the right direction from the very begining again! Thanks for your anticipated response.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34870
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saheed,
"it doesn't work" is a bit vague in terms of us trying to help. What error message are you getting? Do you have sample code? Please post more details so we can work figuring out the problem.
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saheed!

I think you are using Dollar$one database and its sample.java file.

If you go through properly then you can understand that this sample file is just to let you know how to work in java using Dollar$one databse. You have to find out your requirements in that particular sample.java file and make new .java file and run it.

Correct me if i am wrong.
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Here is a sample code i got off the internet regarding connecting to mysql and modifying it i have the following


The above code when run gives me the output of "cannot connect to database" and then gives "com.mysql.jdbc.Driver" from e.getMessage()! I have Mysql installed properly and also have the native driver copied to the appropriate folder in my /JRE/bin/ext(I use a windows box)! Pls any apropriate help would be highly appreciated. Thanks.
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Strangely enough i didnt look through the postings of others! I found someone with the same problem and i am gonna try out the suggested solution! I will be in touch if i get into any trouble! Thanks all!
 
chsanthosh kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Saheed Adepoju:
Hi
Here is a sample code i got off the internet regarding connecting to mysql and modifying it i have the following


The above code when run gives me the output of "cannot connect to database" and then gives "com.mysql.jdbc.Driver" from e.getMessage()! I have Mysql installed properly and also have the native driver copied to the appropriate folder in my /JRE/bin/ext(I use a windows box)! Pls any apropriate help would be highly appreciated. Thanks.




Hi All,
The same code i excuted in my system.And it is working finr for me.
First it's given Error Message(As the aboveOnly..)
After i changed the classpath using mysql connector jar file(mysql-connector-java-3.0.10-stable-bin.jar).
I Placed this file in my Classpath.Now it is working fine for me.

Please Check the same.
Thank You.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic