|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.spotfire.ws.im.ds.sql.BasicJDBCMetadataProvider
public class BasicJDBCMetadataProvider
A basic implementation of the JDBCMetadataProvider interface.
| Constructor Summary | |
|---|---|
BasicJDBCMetadataProvider()
Creates a new BasicJDBCMetadataProvider instance. |
|
| Method Summary | |
|---|---|
MetadataItem |
createCatalogItem(String name)
Creates a catalog item. |
MetadataItem |
createColumnItem(String name,
Class type,
String typeName,
String description)
Creates a column item. |
MetadataItem |
createColumnItem(String name,
int jdbcType,
String typeName,
int precision,
int scale,
String description)
Creates a column item. |
MetadataItem |
createSchemaItem(String name)
Creates a schema item. |
MetadataItem |
createTableItem(String name)
Creates a table item. |
protected MetadataItem[] |
getCatalogs()
Returns a list of catalog items. |
protected MetadataItem[] |
getColumns(String catalog,
String schema,
String table)
Returns a list of column items. |
JDBCContext |
getContext()
Returns the JDBCContext. |
MetadataItem[] |
getMetadata(MetadataItem[] path)
Returns a list of MetadataItem objects that
corresponds to the given path. |
protected ProcedureMetadata |
getProcedureMetadata(String catalog,
String schema,
String procedure)
|
protected MetadataItem[] |
getProcedures(String catalog,
String schema)
|
protected MetadataItem[] |
getSchemas(String catalog)
Returns a list of schema items. |
protected MetadataItem[] |
getTableAliases(String catalog,
String schema)
|
protected MetadataItem[] |
getTables(String catalog,
String schema)
Returns a list of table items. |
void |
setContext(JDBCContext context)
Sets the JDBCContext. |
static MetadataItem[] |
sortMetadataItemsByName(MetadataItem[] items)
|
Class |
toJavaType(int jdbcType,
String typeName,
int precision,
int scale)
Converts a JDBC type to a Java type. |
int |
toJDBCType(Class c)
Converts a Java type to a JDBC type. |
protected void |
verifyCatalog(DatabaseMetaData dbmd,
String catalog)
|
protected void |
verifySchema(DatabaseMetaData dbmd,
String catalog,
String schema)
|
protected void |
verifyTable(DatabaseMetaData dbmd,
String catalog,
String schema,
String table)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BasicJDBCMetadataProvider()
BasicJDBCMetadataProvider instance.
| Method Detail |
|---|
public void setContext(JDBCContext context)
JDBCMetadataProviderJDBCContext.
setContext in interface JDBCMetadataProviderpublic JDBCContext getContext()
JDBCContext.
JDBCContext instance
public MetadataItem[] getMetadata(MetadataItem[] path)
throws InvalidMetadataPath
JDBCMetadataProviderMetadataItem objects that
corresponds to the given path.
getMetadata in interface JDBCMetadataProviderpath - a path of MetadataItem objects.
MetadataItem objects.
InvalidMetadataPath - if the given path is invalid
protected MetadataItem[] getCatalogs()
throws InvalidMetadataPath
InvalidMetadataPath - if the catalog level is not supported
SQLException - if a database error occurs
protected MetadataItem[] getSchemas(String catalog)
throws InvalidMetadataPath
catalog - a catalog name, may be ""
InvalidMetadataPath - if the catalog is invalid or
if the schema level is not supported
SQLException - if a database error occurs
protected MetadataItem[] getTables(String catalog,
String schema)
throws InvalidMetadataPath
catalog - a catalog name, may be ""schema - a schema name, may be ""
InvalidMetadataPath - if the given catalog or schema is invalid
SQLException - if a database error occurs
protected MetadataItem[] getTableAliases(String catalog,
String schema)
protected MetadataItem[] getColumns(String catalog,
String schema,
String table)
throws InvalidMetadataPath
catalog - a catalog name, may be ""schema - a schema name, may be ""table - a table name, may be ""
InvalidMetadataPath - if the given catalog, schema or table is invalid
SQLException - if a database error occurs
protected MetadataItem[] getProcedures(String catalog,
String schema)
protected ProcedureMetadata getProcedureMetadata(String catalog,
String schema,
String procedure)
protected void verifyCatalog(DatabaseMetaData dbmd,
String catalog)
throws InvalidMetadataPath
InvalidMetadataPath
protected void verifySchema(DatabaseMetaData dbmd,
String catalog,
String schema)
throws InvalidMetadataPath
InvalidMetadataPath
protected void verifyTable(DatabaseMetaData dbmd,
String catalog,
String schema,
String table)
throws InvalidMetadataPath
InvalidMetadataPathpublic MetadataItem createCatalogItem(String name)
name - a catalog name
public MetadataItem createSchemaItem(String name)
name - a schema name
public MetadataItem createTableItem(String name)
name - a table name
public MetadataItem createColumnItem(String name,
Class type,
String typeName,
String description)
name - a column nametype - a column typetypeName - data source dependent type namedescription - comment describing column
BasicJDBCMetadataProvider.toJavaType(int, java.lang.String, int, int)
public MetadataItem createColumnItem(String name,
int jdbcType,
String typeName,
int precision,
int scale,
String description)
name - a column namejdbcType - a JDBC typetypeName - data source dependent type nameprecision - a precision, used for numeric typesscale - a scale, used for numeric typesdescription - comment describing column
BasicJDBCMetadataProvider.toJavaType(int, java.lang.String, int, int)
public Class toJavaType(int jdbcType,
String typeName,
int precision,
int scale)
JDBCMetadataProviderThe following Java types are supported:
StringIntegerLongFloatDoublecom.spotfire.ws.dat.Datecom.spotfire.ws.dat.Timecom.spotfire.ws.dat.DateTimecom.spotfire.ws.dat.Clobcom.spotfire.ws.dat.Blob
toJavaType in interface JDBCMetadataProviderjdbcType - a JDBC typetypeName - data source dependent type nameprecision - a precision used for numberic typesscale - a scale used for numeric types
Typespublic int toJDBCType(Class c)
JDBCMetadataProviderThe following Java types must be supported:
StringIntegerLongFloatDoublecom.spotfire.ws.dat.Datecom.spotfire.ws.dat.Timecom.spotfire.ws.dat.DateTimecom.spotfire.ws.dat.Clobcom.spotfire.ws.dat.Blob
toJDBCType in interface JDBCMetadataProviderc - a Java type
Typespublic static MetadataItem[] sortMetadataItemsByName(MetadataItem[] items)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||