• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBC and MySQL

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic