Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC and MySQL

 
Sam Kot
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam new to JDBC, pls somebody help me with some instructions to install and access mysql and connect it using JDBC. I was working with PHP/MySQL and things were easy with php. Iam struggling with Java, pls help me.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For installation of MySQL see the docs here.
For information on JDBC see Sun's JDBC Tutorial
 
Sam Kot
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do have MySQL installed in my computer, I want to know how to connect and what driver to download
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few other hints. You can get the JDBC drivers here: Connector/J 3.0. Make sure that you put the driver JAR file where your JDK/JVM can find them.
To connect, you'll do something like the following:

Of course you'll have to supply the ip-address of where the database is located (you can use "localhost" if it's on the same machine), the database instance (or it can be left off), the user and password (if required). After that it's just regular ol' JDBC stuff.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sam Kot:
I do have MySQL installed in my computer, I want to know how to connect and what driver to download

Like Wayne said, Connector/J. As far as how to connect, if you had even glanced at the link to the JDBC tutorial I sent you, you wouldn't have had to ask the question again. We love helping people, but you need to do your part as well. Wayne is much more gracious than I am since you appearntly didn't even take advantage of the links I provided for you.
 
Ravi Kanth D
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JDK 1.4, you can just download the MySQL JDBC driver Jar file and put it in the folder:
j2sdk1.4.2/jre/lib/ext/
 
Sam Kot
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam not trying to be annoy anybody here, I really appreciate ur time in helping me. the last reply was very helpful.
Thanks a lot
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic