Java SQL ResultSet Dump dump(ResultSet set)

Here you can find the source of dump(ResultSet set)

Description

dump

License

Open Source License

Declaration

public static void dump(ResultSet set) throws SQLException 

Method Source Code


//package com.java2s;
/*/*from w w w.j a  v a 2  s .co m*/
 * Schemamule, a library for automating database schema tasks
 * Copyright (C) 2006, Moses M. Hohman and Rhett Sutphin
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St., 5th Floor, Boston, MA  02110-1301
    
 * To contact the authors, send email to:
 * { mmhohman OR rsutphin } AT sourceforge DOT net
 */

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.ResultSetMetaData;

public class Main {
    public static void dump(ResultSet set) throws SQLException {
        ResultSetMetaData data = set.getMetaData();
        System.err.println();
        while (set.next()) {
            for (int i = 1; i <= data.getColumnCount(); i++) {
                System.err.print(data.getColumnName(i));
                System.err.print(":");
                System.err.println(set.getObject(i));
            }
            System.err.println();
        }
    }
}

Related

  1. dump(ResultSet rs)
  2. dump(ResultSet rset)
  3. dumpResultSet(ResultSet dbResult)
  4. dumpResultSet(ResultSet resultSet, String tablename, String[] columns)
  5. dumpResultSet(ResultSet rs)
  6. dumpResultSet(ResultSet rs)