package com.test.dbc.server;



import com.mysql.jdbc.Connection;
import java.sql.SQLException;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author MOHAMED
 */
public class DAO {

    private static DAO dao;
    private java.sql.Connection con;

    private DAO() throws ClassNotFoundException, SQLException {
        String url = "jdbc:mysql://localhost:3307/localdb";
        Class.forName("com.mysql.jdbc.Driver");
        con = java.sql.DriverManager.getConnection(url, "root", "mmaw1234");
    }

    public static DAO getConnection() throws ClassNotFoundException, SQLException {
        if (dao == null) {
            dao = new DAO();
        }
        return dao;
    }

    public java.sql.Connection getCon() {
        return con;
    }
}
