JAPI 0.9.0
Yet another Java API
API Documentation

net.sf.japi.sql
Class SQLHelper

java.lang.Object
  extended by net.sf.japi.sql.SQLHelper

public class SQLHelper
extends Object

A Helper Class to make work with JDBC less painful in some situations.

Author:
Christian Hujer

Constructor Summary
SQLHelper()
           
 
Method Summary
static String[] getColumnLabels(ResultSet rs)
          Get a ResultSet's Column Labels.
static String[] getColumnNames(ResultSet rs)
          Get a ResultSet's Column Names.
static Object[][] getData(ResultSet rs)
          Get a ResultSet's result.
static int getRowCount(ResultSet rs)
          Get a ResultSet's size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLHelper

public SQLHelper()
Method Detail

getColumnNames

public static String[] getColumnNames(ResultSet rs)
                               throws SQLException
Get a ResultSet's Column Names. The names are physical. For names for display @see #getColumnLabels(ResultSet).

Parameters:
rs - ResultSet
Returns:
column names
Throws:
SQLException - on SQL problems

getColumnLabels

public static String[] getColumnLabels(ResultSet rs)
                                throws SQLException
Get a ResultSet's Column Labels. The names are for display. For physical names @see #getColumnNames(ResultSet).

Parameters:
rs - ResultSet
Returns:
column labels
Throws:
SQLException - on SQL problems

getData

public static Object[][] getData(ResultSet rs)
                          throws SQLException
Get a ResultSet's result.

Parameters:
rs - ResultSet
Returns:
two-dimensional Array containing the results
Throws:
SQLException - on SQL problems

getRowCount

public static int getRowCount(ResultSet rs)
                       throws SQLException
Get a ResultSet's size. Warning: The ResultSet's Cursor is moved by invoking this method!

Parameters:
rs - ResultSet
Returns:
the number of rows in this ResultSet
Throws:
SQLException - on SQL problems

JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright