Here you can find the source of printWarnings(ResultSet resultSet)
public static void printWarnings(ResultSet resultSet) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.ResultSet; import java.sql.Statement; import java.sql.SQLException; import java.sql.SQLWarning; public class Main { public static void printWarnings(ResultSet resultSet) throws SQLException { System.out.println("Resultset warnings begin:"); if (resultSet != null) { SQLWarning warning = resultSet.getWarnings(); if (warning != null) warning = warning.getNextWarning(); if (warning != null) System.out.println("Message: " + warning.getMessage()); }/*from ww w . j ava 2 s. c o m*/ System.out.println("Resultset warnings end"); } public static void printWarnings(Statement stmt) throws SQLException { System.out.println("Resultset warnings begin:"); if (stmt != null) { SQLWarning warning = stmt.getWarnings(); if (warning != null) warning = warning.getNextWarning(); if (warning != null) System.out.println("Message: " + warning.getMessage()); } System.out.println("Resultset warnings end"); } }