/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.ddns.grupotsergio;

import java.sql.*;

/**
 *
 * @author Edson
 */
public class Conexao {
    private static Connection conn;

    public static Connection conectar() throws Exception{
        String driver = "org.gjt.mm.mysql.Driver";
        String url = "jdbc:mysql://localhost:3306/ct_dados";
        String login = "root";
        String senha =  "Edson";
        try{
            Class.forName(driver);
            conn = DriverManager.getConnection(url,login,senha);
        }catch(Exception e){
            e.printStackTrace();
        }
        return conn;
    }

    public static Connection getConnection(){
        return conn;
    }

    public static void destroy(){
        conn = null;
    }
}
