package com.izouma.awesomeadmin.util;

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

public abstract class JDBC {

    public static synchronized Connection connectDB(String DRIVER, String URL, String USER, String PASSWORD) {
        try {
            Class.forName(DRIVER);
            Connection conn = DriverManager.getConnection(URL, USER, PASSWORD);
            System.out.println("JDBCUtils connect DB successful!");
            return conn;
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("JDBCUtils connect DB error!");
            return null;
        }
    }
}


