Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: JDBC JAVA MYSQL

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default JDBC JAVA MYSQL

    Hey guys? I was wondering how to connect a MYSQL database to JAVA using a Connector /J. I have the following -
    @java sql connector /j.msi // I read that it's supposed to be a jar file but I can only find a .msi file on the download website.
    @wamp server
    @eclipse adt
    Someone explain to me how please. I'm frustrated.


  2. #2
    Member
    Join Date
    May 2013
    Posts
    96
    My Mood
    Amused
    Thanks
    16
    Thanked 9 Times in 9 Posts

    Default Re: JDBC JAVA MYSQL

    It took me some time to figure out too. The driver loading was the hardest part. I found the driver easily enough, but something about loading it up in Eclipse was hard to figure out. I wrote it down somewhere in a notebook, but that's... somewhere far away and I can't get to it for a few hours.

    MSI files are just Microsoft installer files. Try running the MSI file after downloading it. If I recall correctly, you select a location to install it to, and it installs a folder containing the JAR file. Mine (downloaded not too long ago, sometime toward the end of June) is called mysql-connector-java-5.1.25 and contains a bunch of files, including mysql-connector-java-5.1.25-bin.jar. I can't remember the exact procedure I used in Eclipse to install it. Like I said, I wrote it down somewhere because I kept forgetting, but I won't have access to that notebook until later this morning.

    Do you know the steps involved in setting up a Connection, a Statement, and running queries after you get the driver loaded?

  3. The Following User Says Thank You to mstabosz For This Useful Post:

    kevthanewversi (September 22nd, 2013)

  4. #3
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    589
    My Mood
    Sleepy
    Thanks
    10
    Thanked 87 Times in 80 Posts

    Default Re: JDBC JAVA MYSQL

    You just have to add the Jar file to your project's build path.

  5. The Following User Says Thank You to PhHein For This Useful Post:

    kevthanewversi (September 22nd, 2013)

  6. #4
    Junior Member
    Join Date
    Mar 2013
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: JDBC JAVA MYSQL

    Thank you! My problem is that when I try to unpack the. msi file it says it's corrupted. I thought .msi files could be unarchived? I don't really know how to do that too and would very much appreciate if you showed me how.

  7. #5
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    589
    My Mood
    Sleepy
    Thanks
    10
    Thanked 87 Times in 80 Posts

    Default Re: JDBC JAVA MYSQL

    .msi is a winblows installer file. Double click it in windows.

  8. #6
    Junior Member
    Join Date
    Oct 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JDBC JAVA MYSQL

    there is jar file available for connectivity if you are failed to find it then search for a zip file there are files containing jar files on official site

  9. #7
    Member vigneshwaran's Avatar
    Join Date
    Nov 2012
    Location
    Chennai, TamilNadu
    Posts
    35
    My Mood
    Cheerful
    Thanks
    7
    Thanked 1 Time in 1 Post

    Default Re: JDBC JAVA MYSQL

    WAMP is a WebServer, Eclipse is an IDE.

    The jar files are the libraries that are needed to make java work with MYSQL database.
    there will be 3 jar files that has to be installed.

    Open Eclipse, select the project on the Left Pane at which you are working with.

    When expanding (+ symbol) you may see Library folder..
    On that, Right click and choose add JAR/Files..
    Browse to the folder that having these 3 needed jar files.
    Select all those and add into your project.

    Thats it.

    Thanks.
    Vigneshwaran R.R

Similar Threads

  1. com.mysql.jdbc.JDBC4Connection suspected memory leak in java
    By newbie14 in forum JDBC & Databases
    Replies: 0
    Last Post: July 4th, 2013, 10:57 PM
  2. JDBC Problem - com.mysql.jdbc.Driver
    By icu222much in forum Java Servlet
    Replies: 2
    Last Post: November 21st, 2011, 10:54 PM
  3. JDBC+MYSQL
    By maya700 in forum JDBC & Databases
    Replies: 1
    Last Post: September 19th, 2011, 02:30 PM
  4. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    By i4ba1 in forum JDBC & Databases
    Replies: 2
    Last Post: August 23rd, 2011, 12:41 PM