Example usage for java.sql SQLWarning setStackTrace

List of usage examples for java.sql SQLWarning setStackTrace

Introduction

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

Prototype

public void setStackTrace(StackTraceElement[] stackTrace) 

Source Link

Document

Sets the stack trace elements that will be returned by #getStackTrace() and printed by #printStackTrace() and related methods.

Usage

From source file:com.axibase.tsd.driver.jdbc.strategies.Consumer.java

private static void fillWarnings(List<WarningSection> warningSections, StatementContext context) {
    if (warningSections != null) {
        for (AtsdExceptionRepresentation section : warningSections) {
            SQLWarning sqlw = new SQLWarning(section.getMessage(), section.getState());
            List<StackTraceElement> list = getStackTrace(section);
            sqlw.setStackTrace(list.toArray(new StackTraceElement[list.size()]));
            context.addWarning(sqlw);/* w ww . ja va  2s  . c om*/
        }
    }
}