Here you can find the source of printResultSetColumns(ResultSet rs)
Parameter | Description |
---|---|
rs | a parameter |
public static void printResultSetColumns(ResultSet rs)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; public class Main { /**//from www . ja va 2s . c o m * DOC xqliu Comment method "printResultSetColumns". * * @param rs */ public static void printResultSetColumns(ResultSet rs) { try { ResultSetMetaData metaData = rs.getMetaData(); int columnSize = metaData.getColumnCount(); for (int i = 0; i < columnSize; ++i) { System.out.println("[" + (i + 1) + "]:" + metaData.getColumnName(i + 1));//$NON-NLS-1$//$NON-NLS-2$ } } catch (SQLException e) { e.printStackTrace(); } } }