package com.nisum.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBConnection {
    private static final String URL = "jdbc:mysql://localhost:3306/ecom";
    private static final String User = "root", password = "root";
    static {
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
        } catch (ClassNotFoundException e)
        {
            throw new RuntimeException(e);
        }
    }
    public static Connection get() throws SQLException{
        return DriverManager.getConnection(URL, User, password);
    }
}
