org.progeeks.meta.jdbc
Class JdbcUtils

java.lang.Object
  extended by org.progeeks.meta.jdbc.JdbcUtils

public class JdbcUtils
extends java.lang.Object

Provides utility methods for obtaining meta objects from JDBC result sets.

Version:
$Revision: 1.5 $
Author:
Paul Wisneskey

Constructor Summary
JdbcUtils()
           
 
Method Summary
static MetaClass getResultSetMetaClass(java.lang.Class type)
          Returns the appropriate meta-class for the specified Java class searching in the context class registry.
static MetaClass getResultSetMetaClass(java.lang.Class type, MetaClassRegistry classRegistry)
          Returns the appropriate meta-class for the specified Java class.
static java.util.List getResultSetPropertyInfos(MetaClassRegistry classRegistry, java.sql.ResultSet resultSet)
          Retrieves the list of property infor objects for the specified ResultSet by examining the set's meta-data.
static java.util.List getResultSetPropertyInfos(MetaClassRegistry classRegistry, java.sql.ResultSet resultSet, boolean resolveTypes)
          Retrieves the list of property infor objects for the specified ResultSet by examining the set's meta-data.
static java.util.List getResultSetPropertyInfos(java.sql.ResultSet resultSet)
          Retrieves the list of property infor objects for the specified ResultSet by examining the set's meta-data.
static java.util.List getResultSetPropertyInfos(java.sql.ResultSet resultSet, boolean resolveTypes)
          Retrieves the list of property infor objects for the specified ResultSet by examining the set's meta-data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcUtils

public JdbcUtils()
Method Detail

getResultSetMetaClass

public static MetaClass getResultSetMetaClass(java.lang.Class type,
                                              MetaClassRegistry classRegistry)
Returns the appropriate meta-class for the specified Java class. If an appropriate meta-class has not been registered then this method returns null.

Parameters:
type - Class to look for meta-class for.
classRegistry - Meta-class registry to search.

getResultSetMetaClass

public static MetaClass getResultSetMetaClass(java.lang.Class type)
Returns the appropriate meta-class for the specified Java class searching in the context class registry. If an appropriate meta-class has not been registered then this method returns null.

Parameters:
type - Class to look for meta-class for.

getResultSetPropertyInfos

public static java.util.List getResultSetPropertyInfos(MetaClassRegistry classRegistry,
                                                       java.sql.ResultSet resultSet,
                                                       boolean resolveTypes)
                                                throws java.sql.SQLException
Retrieves the list of property infor objects for the specified ResultSet by examining the set's meta-data.

Parameters:
classRegistry - Meta-class registry to use for resolving dependent types.
resultSet - Result set to generate property list for.
resolveTypes - Flag to indicate if type resolution should be deferred (if false).
Returns:
List of PropertyInfo objects for the columns in the result set.
Throws:
java.sql.SQLException - If there is a problem retrieved the result set's meta data.

getResultSetPropertyInfos

public static java.util.List getResultSetPropertyInfos(MetaClassRegistry classRegistry,
                                                       java.sql.ResultSet resultSet)
                                                throws java.sql.SQLException
Retrieves the list of property infor objects for the specified ResultSet by examining the set's meta-data. Normal property types will be marked deferred and resolved at a later time.

Parameters:
classRegistry - Meta-class registry to use for resolving dependent types.
resultSet - Result set to generate property list for.
Returns:
List of PropertyInfo objects for the columns in the result set.
Throws:
java.sql.SQLException - If there is a problem retrieved the result set's meta data.

getResultSetPropertyInfos

public static java.util.List getResultSetPropertyInfos(java.sql.ResultSet resultSet)
                                                throws java.sql.SQLException
Retrieves the list of property infor objects for the specified ResultSet by examining the set's meta-data. And dependent meta-class lookups are done using the context class registry. Normal property types will be marked deferred and resolved at a later time.

Parameters:
resultSet - Result set to generate property list for.
Returns:
List of PropertyInfo objects for the columns in the result set.
Throws:
java.sql.SQLException - If there is a problem retrieved the result set's meta data.

getResultSetPropertyInfos

public static java.util.List getResultSetPropertyInfos(java.sql.ResultSet resultSet,
                                                       boolean resolveTypes)
                                                throws java.sql.SQLException
Retrieves the list of property infor objects for the specified ResultSet by examining the set's meta-data. And dependent meta-class lookups are done using the context class registry.

Parameters:
resultSet - Result set to generate property list for.
resolveTypes - Flag to indicate if type resolution should be deferred (if false).
Returns:
List of PropertyInfo objects for the columns in the result set.
Throws:
java.sql.SQLException - If there is a problem retrieved the result set's meta data.


Copyright © 2002-2003 Paul Speed. All Rights Reserved.