Package com.aceql.jdbc.commons.metadata
Class RemoteDatabaseMetaData
java.lang.Object
com.aceql.jdbc.commons.metadata.RemoteDatabaseMetaData
public class RemoteDatabaseMetaData extends Object
Allows to easily retrieve metadata info of the remote SQL database:
- Schema description in HTML or Text format.
- Databases object wrappers: Tables, Columns, Indexes, etc.
- Author:
- Nicolas de Pomereu
-
Constructor Summary
Constructors Constructor Description RemoteDatabaseMetaData(AceQLConnection aceQLConnection)
Constructor -
Method Summary
Modifier and Type Method Description void
dbSchemaDownload(File file)
Downloads in HTML format the whole schema of the remote database in the passed file.void
dbSchemaDownload(File file, String format)
Downloads the whole schema of the remote database in the passed file, in the specified HTML or Text format.void
dbSchemaDownload(File file, String format, String tableName)
Downloads the schema extract for a table name in the specified HTML or Text format.JdbcDatabaseMetaData
getJdbcDatabaseMetaData()
Returns the basic meta data values of the remote database, as sent by the the remote JDBC Driver of the remote database.Table
getTable(String name)
Returns from the remote database a Table object that contains all the table's details.List<String>
getTableNames()
Returns the table names of the remote database.List<String>
getTableNames(String tableType)
Returns the table names of the remote database.
-
Constructor Details
-
RemoteDatabaseMetaData
Constructor- Parameters:
aceQLConnection
- the Connection to the remote database.
-
-
Method Details
-
dbSchemaDownload
public void dbSchemaDownload(File file, String format, String tableName) throws IOException, AceQLExceptionDownloads the schema extract for a table name in the specified HTML or Text format.- Parameters:
file
- the file to download the remote schema informat
- the format to use: "html" or "text".tableName
- the table name filter, without dot separator. All tables are downloaded if null.- Throws:
IOException
- if any local I/O Exception occursAceQLException
- if any other Exception occurs
-
dbSchemaDownload
Downloads the whole schema of the remote database in the passed file, in the specified HTML or Text format.- Parameters:
file
- the file to download the remote schema informat
- the format to use: "html" or "text". Defaults to "html" if null.- Throws:
NullPointerException
- if file is nullIOException
- if any local I/O Exception occursAceQLException
- if any other Exception occurs
-
dbSchemaDownload
Downloads in HTML format the whole schema of the remote database in the passed file.- Parameters:
file
- the file to download the remote schema in- Throws:
NullPointerException
- if file is nullIOException
- if any local I/O Exception occursAceQLException
- if any Exception occurs
-
getJdbcDatabaseMetaData
Returns the basic meta data values of the remote database, as sent by the the remote JDBC Driver of the remote database.- Returns:
- the basic meta data values sent by the the remote JDBC Driver of the remote database.
- Throws:
AceQLException
- if any Exception occurs
-
getTableNames
Returns the table names of the remote database.- Returns:
- the database table names (all types).
- Throws:
AceQLException
- if any Exception occurs
-
getTableNames
Returns the table names of the remote database.- Parameters:
tableType
- the table type. Can be null. Possible values: "table", "view", etc. Defaults to all types if tableType is null.- Returns:
- the database table names for the passed table type.
- Throws:
AceQLException
- if any Exception occurs
-
getTable
Returns from the remote database a Table object that contains all the table's details.- Parameters:
name
- the name table to get- Returns:
- the fetched table
- Throws:
NullPointerException
- if tableName is nullAceQLException
- if any Exception occurs
-