package Util;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class DBUtil {
	public static void closeConnection(Connection con)
	{
		try
		{
	        if(con != null)
	        {
				con.setAutoCommit(true);
	        	con.close();
	        }
		}
		catch (SQLException sqle)
		{
			sqle.printStackTrace();
		}
	}
	public static void closeStmt(Statement stmt)
	{
		try
		{
	        if(stmt != null)
	        {
	        	stmt.close();
	        }
		}
		catch (SQLException sqle)
		{
			sqle.printStackTrace();
		}
	}
	
	public static void closeResultSet(ResultSet rs)
	{
		try
		{
	        if(rs != null)
	        {
	        	rs.close();
	        }
		}
		catch (SQLException sqle)
		{
			sqle.printStackTrace();
		}
	}
}
