|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.workingdogs.village.Schema
public final class Schema
The Schema object represents the Columns in a database table. It contains a collection of Column objects.
Constructor Summary | |
---|---|
Schema()
A blank Schema object |
Method Summary | |
---|---|
java.lang.String |
attributes()
List of columns to select from the table |
Column |
column(int i)
Returns the requested Column object at index i |
Column |
column(java.lang.String colName)
Returns the requested Column object by name |
java.lang.String[] |
getAllTableNames()
returns all table names that this Schema represents |
Column |
getColumn(java.lang.String colName)
Returns the requested Column object by name |
Column |
getColumn(java.lang.String tableName,
java.lang.String colName)
Returns the requested Column object belonging to the specified table by name |
java.lang.String |
getTableName()
returns the table name that this Schema represents |
int |
index(java.lang.String colName)
Gets the index position of a named column. |
int |
index(java.lang.String tableName,
java.lang.String colName)
Gets the index position of a named column. |
static void |
initSchemas(java.sql.Connection conn)
Initialize all table schemas reachable from this connection |
boolean |
isSingleTable()
Checks to see if this DataSet represents one table in the database. |
int |
numberOfColumns()
Gets the number of columns in this Schema |
Schema |
schema(java.sql.Connection conn,
java.lang.String tableName)
Creates a Schema with all columns |
Schema |
schema(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String columnsAttribute)
Creates a Schema with the named columns in the columnsAttribute |
java.lang.String |
tableName()
returns the table name that this Schema represents |
java.lang.String |
toString()
This returns a representation of this Schema |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Schema()
Method Detail |
---|
public static void initSchemas(java.sql.Connection conn) throws java.sql.SQLException
conn
- a database connection
java.sql.SQLException
- if retrieving the database meta data is unsuccessfulpublic Schema schema(java.sql.Connection conn, java.lang.String tableName) throws java.sql.SQLException, DataSetException
conn
- tableName
-
java.sql.SQLException
DataSetException
public Schema schema(java.sql.Connection conn, java.lang.String tableName, java.lang.String columnsAttribute) throws java.sql.SQLException, DataSetException
conn
- tableName
- columnsAttribute
-
java.sql.SQLException
DataSetException
public java.lang.String attributes()
public Column column(int i) throws DataSetException
i
-
DataSetException
public Column column(java.lang.String colName) throws DataSetException
colName
-
DataSetException
public Column getColumn(java.lang.String colName) throws DataSetException
colName
-
DataSetException
public Column getColumn(java.lang.String tableName, java.lang.String colName) throws DataSetException
tableName
- colName
-
DataSetException
public java.lang.String getTableName() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public java.lang.String[] getAllTableNames()
public int index(java.lang.String colName) throws DataSetException
colName
-
DataSetException
public int index(java.lang.String tableName, java.lang.String colName) throws DataSetException
tableName
- colName
-
DataSetException
public boolean isSingleTable()
public int numberOfColumns()
public java.lang.String tableName() throws DataSetException
DataSetException
- TODO: DOCUMENT ME!public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |