public static boolean writePCData2DB(String id, PCDataType type) {
        DruidPooledConnection connection = null;
        PreparedStatement preparedStatement = null; // 处理sql预编译对象

        try {
            connection = mySQLPool.getConnection(); // 连上数据库
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            String now = sdf.format(new Date());

            switch (type) {
            case GET: {// PC get the alarm
                preparedStatement = connection
                        .prepareStatement("update fpp_alarm "
                                + "set gtime = ? " + "where id = ?");
                // 设置数据库参数
                preparedStatement.setString(1, now);
                preparedStatement.setString(2, id);

                // 判断是否处理成功
                if (preparedStatement.executeUpdate() != 0)
                    return true;
                else
                    return false;
            }
            case HANDLE: {// PC has handle the alarm
                preparedStatement = connection
                        .prepareStatement("update fpp_alarm "
                                + "set etime = ? " + "where id = ?");
                preparedStatement.setString(1, now);
                preparedStatement.setString(2, id);

                if (preparedStatement.executeUpdate() != 0)
                    return true;
                else
                    return false;
            }
            case WRONGID: {// PC get the wrong alarm
                preparedStatement = connection
                        .prepareStatement("delete from fpp_alarm "
                                + "where id = ?");
                preparedStatement.setString(1, id);
                if (preparedStatement.executeUpdate() != 0)
                    return true;
                else
                    return false;
            }
            default:
                break;
            }
            return false;
        } catch (SQLException e) {
            // write DB Error
            logger.error("DB ERROR!" + e.getMessage());
        } finally {
            if (connection != null) {
                try {
                    connection.recycle();
                } catch (SQLException e) {
                    // ignore
                }
            }
        }
        return false;
    }