Example usage for java.lang AbstractMethodError getMessage

List of usage examples for java.lang AbstractMethodError getMessage

Introduction

In this page you can find the example usage for java.lang AbstractMethodError getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.executequery.gui.resultset.ResultSetTableModel.java

private void setMetaDataVectors(ResultSetMetaData rsmd) {

    Class<?> metaClass = rsmd.getClass();
    Method[] metaMethods = metaClass.getMethods();

    List<String> columns = null;
    List<String> rowData = null;
    List<List<String>> metaData = null;

    try {/*w  w  w .  j a va2 s  .c  om*/

        int columnCount = rsmd.getColumnCount();
        columns = new ArrayList<String>(metaMethods.length - 1);
        metaData = new ArrayList<List<String>>(columnCount);

        Object[] obj = new Object[1];
        for (int j = 1; j <= columnCount; j++) {

            obj[0] = Integer.valueOf(j);
            rowData = new ArrayList<String>(metaMethods.length - 1);
            for (int i = 0; i < metaMethods.length; i++) {

                String methodName = metaMethods[i].getName();
                if (EXCLUDES.contains(methodName)) {

                    continue;
                }

                Class<?> c = metaMethods[i].getReturnType();

                if (c.isPrimitive() || c.getName().endsWith(STRING)) {

                    if (methodName.startsWith(GET)) {

                        methodName = methodName.substring(3);
                    }

                    try {

                        Object res = metaMethods[i].invoke(rsmd, obj);

                        if (methodName.equals(COLUMN_NAME)) {

                            if (j == 1) {

                                columns.add(0, methodName);
                            }

                            rowData.add(0, objectToString(res));

                        } else {

                            if (j == 1) {

                                columns.add(methodName);
                            }

                            rowData.add(objectToString(res));

                        }

                    } catch (AbstractMethodError e) {
                    } catch (IllegalArgumentException e) {
                    } catch (IllegalAccessException e) {
                    } catch (InvocationTargetException e) {
                    }

                }

            }

            metaData.add(rowData);

        }

    } catch (SQLException e) {

        Log.debug(e.getMessage(), e);
    }

    if (metaDataTableModel == null) {

        metaDataTableModel = new ResultSetMetaDataTableModel();
    }

    metaDataTableModel.setValues(columns, metaData);
}

From source file:org.kuali.coeus.common.impl.attachment.KcAttachmentDataDaoImpl.java

protected void populateReferences(Connection conn) throws SQLException {
    tableReferences = new HashSet<>();
    String catalog = conn.getCatalog();
    String schema = catalog;// w w w. j a  v  a2  s  .c  om

    // this indicates a non-mysql db, so try oracle.
    if (catalog == null) {
        schema = conn.getSchema();
    }
    try {
        if (conn.getMetaData().getSchemas().next()) {
            schema = conn.getSchema();
        }
    } catch (AbstractMethodError e) {
        LOG.info("Unable to retrieve schema, using catalog " + e.getMessage());
    }

    // The Oracle database stores its table names as Upper-Case,
    // if you pass a table name in lowercase characters, it will not work.
    // MySQL does not care.
    ResultSet rs = conn.getMetaData().getExportedKeys(catalog, schema, "FILE_DATA");
    while (rs.next()) {
        tableReferences.add(new TableReference(rs.getString("FKTABLE_NAME"), rs.getString("FKCOLUMN_NAME")));
    }
}