Java JDBC Tutorial – Part 12.2: Connect Java Swing GUI to a MySQL Database

In this video we will learn how to to connect a Java GUI to a MySQL database.

Please SUBSCRIBE to this channel

Download Java Source Code

Did you like my blog post?

Signup now and receive an email when I publish new luv2code content.

I agree to have my personal information transfered to AWeber ( more information )

I will never give away, trade or sell your email address. You can unsubscribe at any time.

2 Comments

  1. Comments  Fatih   |  Thursday, 12 November 2015 at 11:36 am

    Hi Chad, I have a problem with this class.
    I am using your codes and database(demo) but my user and password are different. Therefore I changed demo.properties’s content as
    user: root
    password:********
    dburl=jdbc:mysql://localhost:3306/demo
    and I had this error :

    java.sql.SQLException: Access denied for user ‘root ‘@’localhost’ (using password: YES)

    Please help me. Thanks….

  2. Comments  Chad Darby   |  Thursday, 12 November 2015 at 12:59 pm

    Seems as though you are using the wrong password for the root account.

    I assume for “password:********” … that you actually have the real password there?

    For a MySQL installation, the root password is not set by default. So you could leave the properties file as “password=”.

    If that doesn’t work, then you have two options.

    Option 1: Reset root password
    http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html

    Option 2: Reinstall MySQL database

    Let me know how things work out for you 🙂

Leave a Reply