Example usage for java.sql SQLWarning getClass

List of usage examples for java.sql SQLWarning getClass

Introduction

In this page you can find the example usage for java.sql SQLWarning getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.xqdev.sql.MLSQL.java

private static void addWarnings(Element meta, SQLWarning w) {
    if (w == null)
        return;/*w ww . j  ava  2s.  c o m*/

    Namespace sql = meta.getNamespace();
    Element warnings = new Element("warnings", sql);
    meta.addContent(warnings);
    do {
        warnings.addContent(new Element("warning", sql).setAttribute("type", w.getClass().getName())
                .addContent(new Element("reason", sql).setText(w.getMessage()))
                .addContent(new Element("sql-state", sql).setText(w.getSQLState()))
                .addContent(new Element("vendor-code", sql).setText("" + w.getErrorCode())));
        w = w.getNextWarning();
    } while (w != null);
}