• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Connnecting Java programs to Mysql

 
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 40913
840
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 158
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic