Java SQL Warning printWarnings(SQLWarning warning)

Here you can find the source of printWarnings(SQLWarning warning)

Description

print Warnings

License

Open Source License

Declaration

public static void printWarnings(SQLWarning warning) throws SQLException 

Method Source Code

//package com.java2s;

import java.sql.SQLException;

import java.sql.SQLWarning;

public class Main {
    public static void printWarnings(SQLWarning warning) throws SQLException {
        if (warning != null) {
            System.out.println("\n---Warning---\n");
            while (warning != null) {
                System.out.println("Message: " + warning.getMessage());
                System.out.println("SQLState: " + warning.getSQLState());
                System.out.print("Vendor error code: ");
                System.out.println(warning.getErrorCode());
                System.out.println("");
                warning = warning.getNextWarning();
            }//w  w w. j av a  2s. c o m
        }
    }
}

Related

  1. getFullStackTrace(Throwable t)
  2. getRootCause(Throwable throwable)
  3. getRootCauseStackTrace(Throwable t)
  4. getRootCauseStackTrace(Throwable throwable)
  5. printWarnings(Connection conn)