Click here to Skip to main content
14,218,708 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello everyone!

I'm trying to learn how to code online through a video that my friend gave me.

Its a step by step guide on how to make an Inventory Management or some sort, and I'm done with the GUI.

I followed exactly what the guy did in the video but somehow I'm not getting the DriverManager show up.

Uh. Here it goes:

package TestProject;

import com.mysql.jdbc.Connection;

public class MainWindow extends javax.swing.JFrame {
    public MainWindow() {

    public Connection getConnection()
        Connection con = null;
        con = Driver

At the driver part, I was following this video and at minute 33:25, when he typed Driver, something came up, but mine showed nothing.

I know its supposed to be like

con = DriverManager.getConnection("jdbc:mysql://localhost/products_db2","root","******")

What am I doing wrong? Am I missing a driver or something? I'm trying to connect to a database that I created using myPHPadmin.

I'm very new to programming so sorry for asking a simple question, thanks!

What I have tried:

Very confused and don't know what to do as I'm very new to programming :/
Updated 30-Sep-18 9:06am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Stop wasting time with youtube and make use of proper well-written tutorials: Trail: JDBC(TM) Database Access (The Java™ Tutorials)[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100