aspose file tools*
The moose likes JDBC and the fly likes JDBC and MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC and MySQL" Watch "JDBC and MySQL" New topic
Author

JDBC and MySQL

Sam Kot
Greenhorn

Joined: Nov 06, 2003
Posts: 6
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

Joined: Jul 11, 2001
Posts: 15300
    
    6

For installation of MySQL see the docs here.
For information on JDBC see Sun's JDBC Tutorial


GenRocket - Experts at Building Test Data
Sam Kot
Greenhorn

Joined: Nov 06, 2003
Posts: 6
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

Joined: Sep 03, 2003
Posts: 399
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

Joined: Jul 11, 2001
Posts: 15300
    
    6

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

Joined: Sep 14, 2003
Posts: 18
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

Joined: Nov 06, 2003
Posts: 6
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC and MySQL