@Override
    public Matrix deserializeMatrixResult(int id, TypeMatrixResult typeMatrixResult) throws
            ClassNotFoundException, IOException, SQLException {

        String sqlDeserializeObject = null;

        switch (typeMatrixResult) {
            case MATRIX_FIRST:
                sqlDeserializeObject = "SELECT matrix_first FROM matrix_history WHERE id = ? ;";
                break;
            case MATRIX_SECOND:
                sqlDeserializeObject = "SELECT matrix_second FROM matrix_history WHERE id = ? ;";
                break;
            case MATRIX_RESULT:
                sqlDeserializeObject = "SELECT matrix_result FROM matrix_history WHERE id = ? ;";
                break;
            default:
        }

        statement = connection.prepareStatement(sqlDeserializeObject);
        statement.setInt(1, id);

        result = statement.executeQuery();

        result.next();

        InputStream inputStream = result.getBlob(1).getBinaryStream();
        ObjectInputStream oip = new ObjectInputStream(inputStream);
        Object deSerializedObject = oip.readObject();

        result.close();
        statement.close();

        return (Matrix) deSerializedObject;
    }