package com.nisum.mytime.configuration;

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

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DbConnection {
	
	private static Logger log = LoggerFactory.getLogger(DbConnection.class);

	private static Connection connection = null;

	public static Connection getDBConnection(String dbURL) throws SQLException {
		try {
			Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
			connection = DriverManager.getConnection("jdbc:sqlserver://10.3.45.105:1433;databaseName=smartiSCC", "sa", "nisum@123");
		} catch (ClassNotFoundException cnfex) {
			log.error("Problem in loading or " + "registering mssql JDBC driver", cnfex);
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {              
			// TODO Auto-generated catch block  
			e.printStackTrace();    
		}
		return connection;
	}
}
