Java SQLWarning to String toString(SQLWarning warnings)

Here you can find the source of toString(SQLWarning warnings)

Description

to String

License

Apache License

Declaration

public static String toString(SQLWarning warnings) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.sql.SQLWarning;

import java.util.Arrays;

public class Main {
    public static String toString(SQLWarning warnings) {
        if (warnings == null) {
            return null;
        }//ww  w .  ja v a  2  s .com
        StringBuilder sb = new StringBuilder();
        for (Throwable t : warnings) {
            sb.append("SQL Exception [" + t + "] ");
        }
        return sb.toString();
    }

    public static String toString(Object[] objects) {
        if (objects == null) {
            return null;
        }
        return Arrays.asList(objects).toString();
    }
}

Related

  1. toString(SQLWarning sqlw)