com.zentense.step2.model
Class DBTableData

java.lang.Object
  extended by com.zentense.step2.model.DBTableData

public class DBTableData
extends java.lang.Object

This class implements a pool of prepared statements with the database and is used for getting database tables metadata.

Version:
$Revision: 1.5 $
Author:
Jose R. Cabanes (aka Kurt)

Nested Class Summary
static class DBTableData.Table
          Holds information of a table
 
Constructor Summary
DBTableData()
           
 
Method Summary
static DBTableData.Table getTable(java.lang.String name)
          Gets table information
static java.lang.String[] getTableColumnNames(java.lang.String tableName, java.sql.Connection db)
          Get table column names
static int[] getTableColumnTypes(java.lang.String tableName, java.sql.Connection db)
          Get column types of a table
static void reset()
          Resets table of prepared statements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBTableData

public DBTableData()
Method Detail

reset

public static final void reset()
Resets table of prepared statements


getTable

public static final DBTableData.Table getTable(java.lang.String name)
Gets table information

Parameters:
name - Name of the table
Returns:
A Table object with table information

getTableColumnTypes

public static final int[] getTableColumnTypes(java.lang.String tableName,
                                              java.sql.Connection db)
                                       throws java.lang.Exception
Get column types of a table

Parameters:
tableName - Table name
db - Database connection
Returns:
An array of table column types
Throws:
java.lang.Exception - If there is an error accessing database

getTableColumnNames

public static final java.lang.String[] getTableColumnNames(java.lang.String tableName,
                                                           java.sql.Connection db)
                                                    throws java.lang.Exception
Get table column names

Parameters:
tableName - Table name
db - Database connection
Returns:
An array of column names
Throws:
java.lang.Exception - If there is an error accessing database

 

© Zentense 2008