public static void closeConnection() {
        if(con != null) {
            try {
                con.rollback();
                con.close();
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally {
                con = null;
            }
        }
    }