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 Details

    • RemoteDatabaseMetaData

      public RemoteDatabaseMetaData​(AceQLConnection aceQLConnection)
      Constructor
      Parameters:
      aceQLConnection - the Connection to the remote database.
  • Method Details

    • dbSchemaDownload

      public void dbSchemaDownload​(File file, String format, String tableName) throws IOException, AceQLException
      Downloads the schema extract for a table name in the specified HTML or Text format.
      Parameters:
      file - the file to download the remote schema in
      format - 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 occurs
      AceQLException - if any other Exception occurs
    • dbSchemaDownload

      public void dbSchemaDownload​(File file, String format) throws IOException, AceQLException
      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 in
      format - the format to use: "html" or "text". Defaults to "html" if null.
      Throws:
      NullPointerException - if file is null
      IOException - if any local I/O Exception occurs
      AceQLException - if any other Exception occurs
    • dbSchemaDownload

      public void dbSchemaDownload​(File file) throws IOException, AceQLException
      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 null
      IOException - if any local I/O Exception occurs
      AceQLException - if any Exception occurs
    • getJdbcDatabaseMetaData

      public JdbcDatabaseMetaData getJdbcDatabaseMetaData() throws AceQLException
      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

      public List<String> getTableNames() throws AceQLException
      Returns the table names of the remote database.
      Returns:
      the database table names (all types).
      Throws:
      AceQLException - if any Exception occurs
    • getTableNames

      public List<String> getTableNames​(String tableType) throws AceQLException
      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

      public Table getTable​(String name) throws AceQLException
      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 null
      AceQLException - if any Exception occurs