package Util;

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

public class ConnectionManager {
	private static Connection con = null;
	public static Connection getConnection()
	{
		try
		{
			// Register the JDBC driver for MySQL.
			Class.forName("com.mysql.jdbc.Driver");
			// get a connection from the url based on the username and password
			con = DriverManager.getConnection(GlobalInfo.url, GlobalInfo.db_username, GlobalInfo.db_password);
		}
		catch (SQLException sqle)
		{
			sqle.printStackTrace();
		} 
		catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return con;
	}
}
