/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package salidasautomaticas.mysqldao;

import java.sql.Connection;
import java.sql.DriverManager;
import salidasautomaticas.dao.DAOFactory;
import salidasautomaticas.dao.SalidasDAO;

/**
 *
 * @author sistem08user
 */
public class MysqlDAOFactory extends DAOFactory {

    static {
        try {
            Class.forName("com.mysql.jdbc.Driver");
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    public static Connection obtenerConexion(String base) {
        Connection conexion = null;
        if (base.equals("nuevo")) {
            try {
                conexion = DriverManager.getConnection(
                        "jdbc:mysql://172.16.2.39:3306/nuevo",
                        "melani",
                        "melani");

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return conexion;
    }

    @Override
    public SalidasDAO getSalidasDAO() {
        return new SalidasMysqlDAO();
    }

}
