package blanco.jsf.util;

import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * JSF プロシキ用のユーティリティ
 */
public class BlancoJsfProxyUtil {
    public static Connection getConnection() {
        return null;
    }

    public static void releaseConnection(final Connection conn) {
        try {
            conn.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public static void logIllegalArgumentException(final String gamenId,
            final Exception ex) {
        ex.printStackTrace();
    }

    public static void logIOException(final String gamenId, final Exception ex) {
        ex.printStackTrace();
    }

    public static void logSQLException(final String gamenId, final Exception ex) {
        ex.printStackTrace();
    }

    public static void logException(final String gamenId, final Exception ex) {
        ex.printStackTrace();
    }

    public static void logError(final String gamenId, final Error er) {
        er.printStackTrace();
    }

    public static void redirectPageToErrorHtml(final javax.faces.context.FacesContext ctx) {
        try {
            ctx.getExternalContext().redirect("error.html");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
