Interface BBjAdminDatabase

All Superinterfaces:
BBjAdminCommitPropertyWriter, BBjAdminCommitWriter, BBjAdminPropertyReader, BBjAdminPropertyWriter, Comparable<BBjAdminDatabase>, Remote, Serializable
All Known Implementing Classes:
BBjAdminSimpleDatabase

public interface BBjAdminDatabase extends BBjAdminCommitPropertyWriter, Serializable, Comparable<BBjAdminDatabase>

References an individual database configuration and commands. Provides access to the tables, stored procedures, views, etc. Changes to the database require calls to commit() on the BBjAdminDatabase instance.

The follow code shows some examples for interacting with a BBjAdminDatabas instance including how to get the instance to begin with.

Java Sample

import com.basis.api.admin.BBjAdminFactory;
import com.basis.api.admin.BBjAdminBase;
import com.basis.api.admin.BBjAdminDatabase;
import java.net.InetAddress;
...
BBjAdminBase api = BBjAdminFactory.getBBjAdmin(InetAddress.getByName("myserver"), 2002, true, "admin", "mypassword");
BBjAdminDatabase db = api.getDatabase("ChileCompany");
String databaseName = db.getString(BBjAdminDatabase.DATABASE);

BBjAdminSet tables = db.getTables(false);

BBjAdminTable custTable = db.getTable("CUSTOMER");
String tableName = custTable.getString(BBjAdminTable.NAME);
BBjAdminList columns = custTable.getColumns();
...

BBj Sample

use com.basis.api.admin.BBjAdminFactory
use com.basis.api.admin.BBjAdminBase
use com.basis.api.admin.BBjAdminDatabase
use java.net.InetAddress
...
declare BBjAdminBase api!
declare BBjAdminSet databases!
declare BBjAdminDatabase db!
declare BBjAdminTable custTable!

api! = BBjAdminFactory.getBBjAdmin(InetAddress.getByName("myserver"), 2002, true, "admin", "mypassword")
db! = api!.getDatabase("ChileCompany")
databaseName$ = db!.getString(BBjAdminDatabase.DATABASE)

tables! = db.getTables(0)

custTable! = db!.getTable("CUSTOMER")
tableName$ = custTable!.getString(BBjAdminTable.NAME)
columns! = custTable!.getColumns()
...
  • Field Details

    • DATABASE

      static final String DATABASE
      Case-sensitive name of the database. Data type: String.
      See Also:
    • TYPE

      static final String TYPE
      Type of the database. Data type: String.
      See Also:
    • TIMEOUT

      static final String TIMEOUT
      Timeout in milliseconds for database requests. This is the timeout for individual requests such as execute a query, fetch a single result, etc. Data type: Long.
      See Also:
    • STATEMENT_TIMEOUT

      static final String STATEMENT_TIMEOUT
      Timeout in SECONDS for database file operations on statement execution and result set fetching.
      See Also:
    • CREATE_TABLE_TYPE

      static final String CREATE_TABLE_TYPE
      Default type of file created when executing a CREATE TABLE statement.
      See Also:
    • READ_ONLY

      static final String READ_ONLY
      Sets the read only status for the entire database. If true, the database is read only. Note: This only applies to UPDATE, INSERT and DELETE statements. Stored procedures and triggers that may perform write operations will still be available for execution.
      See Also:
    • READONLY

      static final String READONLY
      Sets the read only status for the entire database. If true, the database is read only. Note: This only applies to UPDATE, INSERT and DELETE statements. Stored procedures and triggers that may perform write operations will still be available for execution.
      See Also:
    • ENFORCE_VARCHAR_LENGTH

      static final String ENFORCE_VARCHAR_LENGTH
      If true, variable length columns will only allow values that fit within the defined length. For legacy purposes, by default, BBj allows values longer than the defined length of a VARCHAR. It is not uncommon for developers to define variable length columns as length 1 (a bad idea by the way, but supported). Setting this attribute to true will cause BBj to behave as most other DBMSs. If false, any length value can be specified for a VARCHAR as long as it does not exceed the maximum length of the record. Data type: Boolean.
      See Also:
    • SPROC_DEBUG

      static final String SPROC_DEBUG
      If set to true, dot-step debugging is available when executing stored procedures. This setting should never be enabled in a live system as it causes terminal windows to open on the server which can cause unintended consequences to users of the system. See Debugging SPROCs and Triggers for more information.
      See Also:
    • DEFAULT_NUMERIC_SCALE

      static final String DEFAULT_NUMERIC_SCALE
      See Also:
    • ESQL_COLLATE

      static final String ESQL_COLLATE
      True/false whether to use collation order on ESQL tables or ASCII order.
      See Also:
    • OPTIMIZED_DATE_COLUMNS

      @Deprecated static final String OPTIMIZED_DATE_COLUMNS
      Deprecated.
      See Also:
    • LOCALE

      static final String LOCALE
      Database Locale as a IETF BCP 47 language tag as describes by the Java documentation for java.util.Locale.toLanguageTag().
      See Also:
    • NUMERIC_STRIP_SPACES

      static final String NUMERIC_STRIP_SPACES
      If true, strip spaces from numeric field values before they are translated into numbers. For example "- 100" will be parsed as "-100".
      See Also:
    • NUMERIC_EMPTY_STRING_AS_ZERO

      static final String NUMERIC_EMPTY_STRING_AS_ZERO
      If true, BBj SQL queries will return type NUMERIC values where the underlying data in the raw record (MKEYED, XKEYED, VKEYED, but NOT ESQL) as zero instead of NULL. This is a backward compatibility setting.
      See Also:
    • OPTIMIZEDATECOLUMNS

      static final String OPTIMIZEDATECOLUMNS
      If set to true, date columns will have optimization available. By default, optimization is disabled for date type columns except for equality optimization, This is because some date columns use underlying data types that are not sortable by ASCII value which is required for full optimization to occur. Only you will know if your data meets this criteria.
      See Also:
    • AUTOCOMMIT

      static final String AUTOCOMMIT
      True if the default for the database should be to use autocommit. This will only matter on tables that support transactions such as ESQL files.
      See Also:
    • CHARSET

      static final String CHARSET
      Used to specify a specific character set used when processing records in the database.
      See Also:
    • DATE_TYPE_DEFS

      static final String DATE_TYPE_DEFS
      A comma-separated list of typedef/dateformat mappings. For example, assume a typedef named MY_DATE which is an integer containing a Julian number. You can specify a date format to be assigned to that typedef to process column values using that typedef as the date format specified. To include such in this value you would use: MY_DATE/Julian
      See Also:
    • STRICT_KEY_CHECKING

      static final String STRICT_KEY_CHECKING
      Used by CREATE TABLE. If true, and if no primary key is specified, causes a primary key to be created using as many columns as can be fit into the 120-character maximum key length restriction. If this option is false, the user must explicitly specify a primary key when creating a table or an error will occur.
      See Also:
    • STRICTKEYCHECKING

      static final String STRICTKEYCHECKING
      See STRICT_KEY_CHECKING
      See Also:
    • ADVISORY_LOCKING

      static final String ADVISORY_LOCKING
      True/false whether to use advisory locking when accessing the data files for tables or not.
      See Also:
    • ADVISORYLOCKING

      static final String ADVISORYLOCKING
      See ADVISORY_LOCKING
      See Also:
    • TRUNCATE_IF_TOO_LONG

      static final String TRUNCATE_IF_TOO_LONG
      If values returned from SQL queries are too long for the defined column, the value will be truncated. This setting is present for backward compatibility as BBx has traditionally allowed defining column lengths to be shorter than the actual data present in the data file. This can cause issues, especially with ODBC driver connections since ODBC applications use memory buffers and thus can cause memory overruns. By setting this to true, this ensures data will never be longer than the defined size in the data dictionary. However, there is potential for truncation so this defaults to false.
      See Also:
    • TRUNCATEIFTOOLONG

      static final String TRUNCATEIFTOOLONG
      See TRUNCATE_IF_TOO_LONG
      See Also:
    • DICTIONARY

      static final String DICTIONARY
      Full path to the data dictionary files (*.1 files for legacy databases, and the *.DD files for enhanced)
      See Also:
    • DATA

      static final String DATA
      Full path to the DATA global variable which is a standard variable used in table data file path specifications to avoid hard-coding paths into the database definition. For example, the ChileCompany database has a CUSTOMER table with a data file named CUSTOMER. The path to that data file is defined as (DATA)CUSTOMER. Specifying a value for DATA to be /usr/local/basis/demos/data/ will then use /usr/local/basis/demos/data/CUSTOMER when it needs to open that data file. It's important to include the trailing slash.
      See Also:
    • ACCESS_POLICY

      static final String ACCESS_POLICY
      The access policy for this database. Valid values are DENY, RO, RW, and ALL. DENY means all users are denied access unless explicitly granted access by being added to the list in the RW_USERS or RO_USERS properties (see those properties for details). If this access policy is set to RO, then all users will have a minimum of read-only access to the database unless they are granted additional access by being added to the RW_USERS list. The ALL setting refers to database admin permissions. This is almost never used in a production DB since this would allow all users admin capabilities.
      See Also:
    • REMOTE_ACCESS_POLICY

      static final String REMOTE_ACCESS_POLICY
      This is another layer of access that refers specifically to connections coming from machines other than the local machine. The settings work the same as ACCESS_POLICY except that they refer to remote connections.
      See Also:
    • ADMIN_USERS

      static final String ADMIN_USERS
      Comma-separated list of usernames who have admin privileges on the database. Users with this privlege (when using legacy permissions) can create/alter/drop tables and write to any table in the database, assuming they aren't limited by OS level file permissions.
      See Also:
    • ADMINUSERS

      static final String ADMINUSERS
      See ADMIN_USERS
      See Also:
    • RW_USERS

      static final String RW_USERS
      Comma-separated list of users who have read-write access to the database. Make sure to see ACCESS_POLICY for details on how the permissions work. There are important caveats.
      See Also:
    • RWUSERS

      static final String RWUSERS
      See RW_USERS
      See Also:
    • RO_USERS

      static final String RO_USERS
      Comma-separated list of users who have read-only access to the database. Make sure to see ACCESS_POLICY for details on how the permissions work. There are important caveats.
      See Also:
    • ROUSERS

      static final String ROUSERS
      See RO_USERS
      See Also:
    • REMOTE_RO_USERS

      static final String REMOTE_RO_USERS
      Comma-separated list of users who have read-only access to the database from remote machines. Make sure to see REMOTE_ACCESS_POLICY for details on how the permissions work. There are important caveats.
      See Also:
    • REMOTE_RW_USERS

      static final String REMOTE_RW_USERS
      Comma-separated list of users who have read-write access to the database from remote machines. Make sure to see REMOTE_ACCESS_POLICY for details on how the permissions work. There are important caveats.
      See Also:
    • REMOTE_DENY_USERS

      static final String REMOTE_DENY_USERS
      Comma-separated list of users who have been explicitly denied access to the database.
      See Also:
    • REMOTE_WHITELIST

      static final String REMOTE_WHITELIST
      Comma-separated list of IP address/hostnames that should NOT be treated as "remote" but rather, follow the permissions defined for local connections.
      See Also:
    • TXN_ISOLATION

      static final String TXN_ISOLATION
      Default transaction isolation level. See java.sql.Connection for transaction isolation levels and their meanings. This level is only applicable to ESQL tables.
      See Also:
    • AUTO_ANALYZE

      static final String AUTO_ANALYZE
      See AUTO_ANALYZE_TABLES
      See Also:
    • AUTO_ANALYZE_TABLES

      static final String AUTO_ANALYZE_TABLES
      True/false whether to allow BBjServices to automatically run table analysis when it deems appropriate. The main downside to leaving this enabled is that depending on the usage of some tables, it may run more often than desirable. That won't impact results, but it may bog down the server if it runs too often.
      See Also:
    • OBJECT_LEVEL_PERMISSIONS

      static final String OBJECT_LEVEL_PERMISSIONS
      True/false to enable object level permissions. See BBj documentation for complete details. Default value is false.
      See Also:
    • DEFAULT_DATE_TYPEDEF

      static final String DEFAULT_DATE_TYPEDEF
      See Also:
    • DEFAULT_DATE_FORMAT

      static final String DEFAULT_DATE_FORMAT
      See Also:
    • SPROC_RUN_AS_USER

      static final String SPROC_RUN_AS_USER
      True/false whether stored procedures should be run as the system user or as the user who connected to the database.
      See Also:
    • SPROC_CLASSPATH

      static final String SPROC_CLASSPATH
      Alternate classpath to use for stored procedure interpreters if the default classpath is not desireable.
      See Also:
    • SQL_FACTORY

      static final String SQL_FACTORY
      BBjSQLFactory implementation class (including package) used to provide custom scalar/group functions accessible by this database. See the Custom Scalar/Group Functions documentation for complete details.
      See Also:
    • SQL_FACTORY_SSCP

      static final String SQL_FACTORY_SSCP
      Session Specific Classpath (SSCP) containing reference to the JAR used to provide custom scalar/group functions accessible by this database. See the Custom Scalar/Group Functions documentation for complete details.
      See Also:
    • HANDLE_VARIABLE_LENGTH_PADDED_VALUES

      static final String HANDLE_VARIABLE_LENGTH_PADDED_VALUES
      NOTE: This is a bit of an unusual setting. Please read carefully and also take a look at the referenced Bugzilla nunmbers to understand the issue completely. This setting was added to handle two opposing fixes. See Bugzilla 30228 and 29221. We can't support both fixes at the same time so we have this config option. The default will always return correct results but may be slow. The "correct" method may return results that people may perceive to be incorrect, but optimization is ideal and the results are actually technically correct.
      See Also:
    • LINKED_DRIVER

      static final String LINKED_DRIVER
      Property used by linked database configurations to indicate the JDBC driver class.
      See Also:
    • LINKED_URL

      static final String LINKED_URL
      Property used by linked database configurations to indicate the URL used to connect to the database.
      See Also:
    • LINKED_SHOULD_RESOLVE_GLOBALS

      static final String LINKED_SHOULD_RESOLVE_GLOBALS
      Property used by linked database configurations to indicate whether it should resolve any globals used.
      See Also:
    • LINKED_USER

      static final String LINKED_USER
      Property used by linked database configurations to indicate the user used to connect to the database.
      See Also:
    • LINKED_PASSWORD

      static final String LINKED_PASSWORD
      Property used by linked database configurations to indicate the password used to connect to the database. This will be encrypted when written to the config.ini file.
      See Also:
    • LINKED_CONNECT_PROPERTIES

      static final String LINKED_CONNECT_PROPERTIES
      Comma separated list of name=value pairs to be used at connect time.
      See Also:
    • LOGLEVEL

      static final String LOGLEVEL
      See Also:
    • LOGFILE

      @Deprecated static final String LOGFILE
      Deprecated.
      See Also:
    • DATE_COLUMNS_SORTED

      @Deprecated static final String DATE_COLUMNS_SORTED
      Deprecated.
      See Also:
    • ANALYSIS_FILTER_NONE

      static final int ANALYSIS_FILTER_NONE
      See Also:
    • ANALYSIS_FILTER_NO_OVERLAPS

      static final int ANALYSIS_FILTER_NO_OVERLAPS
      See Also:
    • ANALYSIS_FILTER_UNINDEXED_ONLY

      static final int ANALYSIS_FILTER_UNINDEXED_ONLY
      See Also:
    • ANALYSIS_FILTER_NO_SINGLES

      static final int ANALYSIS_FILTER_NO_SINGLES
      See Also:
    • EXPORT_FORMAT_JSON

      static final int EXPORT_FORMAT_JSON
      Used with the export() method. Exports the data in a JSON format.
      See Also:
    • EXPORT_FORMAT_HTML

      static final int EXPORT_FORMAT_HTML
      Used with the export() method. Exports the data in a human-readable, nicely formatted set of HTML files.
      See Also:
    • EXPORT_FORMAT_SQL

      static final int EXPORT_FORMAT_SQL
      Used with the export() method. Exports the data as a series of SQL CREATE/ALTER statements.
      See Also:
  • Method Details

    • getUsers

      Get the set of users of a specified type.
      Parameters:
      p_type - Type of users.
      Throws:
      BBjAdminException
    • setUsers

      void setUsers(BBjAdminDatabase.UserType p_type, Set<String> p_users) throws BBjAdminException
      Set all of the users of a specified type.
      Parameters:
      p_type - Type of users.
      p_users - Set of users.
      Throws:
      BBjAdminException
    • addUser

      void addUser(BBjAdminDatabase.UserType p_type, String p_user) throws BBjAdminException
      Add a single user of a specified type.
      Parameters:
      p_type - Type of user.
      p_user - User name to add.
      Throws:
      BBjAdminException
    • removeUser

      void removeUser(BBjAdminDatabase.UserType p_type, String p_user) throws BBjAdminException
      Remove a single user of a specified type.
      Parameters:
      p_type - Type of user.
      p_user - User name to remove.
      Throws:
      BBjAdminException
    • getAccessPolicy

      Get the current access policy.
      Throws:
      BBjAdminException
    • setAccessPolicy

      void setAccessPolicy(BBjAdminDatabase.AccessPolicy p_policy) throws BBjAdminException
      Set the current access policy.
      Parameters:
      p_policy - Policy to set.
      Throws:
      BBjAdminException
    • getType

      Get the database type.
      Throws:
      BBjAdminException
    • setType

      void setType(BBjAdminDatabase.DatabaseType p_type) throws BBjAdminException
      Set the database type.
      Parameters:
      p_type -
      Throws:
      BBjAdminException
    • getDateHandlers

      Get the set of date handlers.
      Throws:
      BBjAdminException
    • setDateHandlers

      void setDateHandlers(BBjAdminSet<BBjAdminDatabase.DateHandler> p_handlers) throws BBjAdminException
      Set the set of date handlers.
      Parameters:
      p_handlers -
      Throws:
      BBjAdminException
    • createDateHandler

      Create a new date handler. It has no effect until it is set and committed.
      Throws:
      BBjAdminException
    • getTables

      BBjAdminSet<BBjAdminTable> getTables(boolean p_includeSystemTables) throws BBjAdminException
      Get a set of all of the tables in the database, optionally including the system tables.
      Parameters:
      p_includeSystemTables - Should system tables be included in the set?
      Throws:
      BBjAdminException
    • getTablesSimpleInfo

      BBjAdminSet<BBjAdminSimpleTableInfo> getTablesSimpleInfo(boolean p_includeSystemTables) throws BBjAdminException
      Get a set of all of the tables in the database, optionally including the system tables. This is different than the getTables() method in that it returns very quick and efficient informational objects. These objects don't have column or index info, only table info. Also, there are no methods for committing changes to the objects. They cut out the network communication used for calling the various set and get methods. This method is best used when you just need a list of tables with basic info.
      Parameters:
      p_includeSystemTables - Should system tables be included in the set?
      Throws:
      BBjAdminException
    • getTableNames

      BBjAdminSet<String> getTableNames(boolean p_includeSystemTables, boolean p_refresh) throws BBjAdminException
      Returns a list of the table names available in the database sorted alphabetically. This is a much more efficient method than calling getTables() as it only retrieves the table names without all the additional table information. Specifying true for p_refresh will cause the cache to be refreshed with the information from disk. Otherwise, if the list of tables is already available, it will pull the data from the cache which can be even more efficient.
      Parameters:
      p_includeSystemTables - Whether it should include the system tables or not.
      p_refresh - Whether it should refresh the internal table name cache list.
      Returns:
      BBjAdminSet containing a list of table names in alphabetical order.
      Throws:
      BBjAdminException
    • getTable

      BBjAdminTable getTable(String p_table) throws BBjAdminException
      Get an individual table in the database by name.
      Parameters:
      p_table -
      Throws:
      BBjAdminException
    • getTable

      BBjAdminTable getTable(String p_table, boolean p_designMode, boolean p_skipAnalysis) throws BBjAdminException
      Get an individual table from the database. Indicate whether you want it to get the indexes from the data file or from the dictionary.
      Parameters:
      p_table - Name of the table.
      p_designMode - Tells server to get indexes and possibly other table information from the data dictionary only. Setting to false means that it may bypass the data dictionary info all together if it is able to derive index information from the file key structure alone.
      p_skipAnalysis - Causes it to skip any automatic table analysis.
      Throws:
      BBjAdminException
    • createTable

      BBjAdminTable createTable() throws BBjAdminException
      Create an empty BBjAdminTable object to be used for table creation.
      Throws:
      BBjAdminException
    • getViews

      Get a set of all of the views in the database.
      Throws:
      BBjAdminException
    • getView

      BBjAdminView getView(String p_name) throws BBjAdminException
      Get an individual view in the database by name.
      Throws:
      BBjAdminException
    • createView

      BBjAdminView createView(String p_name) throws BBjAdminException
      Create an empty BBjAdminView object to be used for view creation.
      Parameters:
      p_name -
      Throws:
      BBjAdminException
    • createView

      BBjAdminView createView() throws BBjAdminException
      Create an empty BBjAdminView object to be used for view creation.
      Throws:
      BBjAdminException
    • dropView

      void dropView(String p_view) throws BBjAdminException
      Drop a single view.
      Parameters:
      p_view -
      Throws:
      BBjAdminException
    • getProcedures

      Get a set of all of the procedures in the database.
      Throws:
      BBjAdminException
    • getProcedure

      BBjAdminProcedure getProcedure(String p_name) throws BBjAdminException
      Get an individual procedure in the database by name.
      Parameters:
      p_name - Name of the procedure.
      Throws:
      BBjAdminException
    • createProcedure

      BBjAdminProcedure createProcedure(String p_name) throws BBjAdminException
      Create an empty BBjAdminProcedure object to be used for procedure creation.
      Parameters:
      p_name - Name of the new procedure.
      Throws:
      BBjAdminException
    • createProcedure

      BBjAdminProcedure createProcedure() throws BBjAdminException
      Create an empty BBjAdminProcedure object to be used for procedure creation.
      Throws:
      BBjAdminException
    • dropProcedure

      void dropProcedure(String p_name, boolean p_removeSource) throws BBjAdminException
      Drop a single procedure.
      Parameters:
      p_name -
      Throws:
      BBjAdminException
    • dropProcedure

      void dropProcedure(String p_name) throws BBjAdminException
      Drop a single procedure and also remove the source code file.
      Parameters:
      p_name -
      Throws:
      BBjAdminException
    • getTypeDefs

      Get a set of all of the type definitions in the database. This does NOT refresh the list of type definitions if they are currently cached.
      Throws:
      BBjAdminException
    • getTypeDefs

      BBjAdminSet<BBjAdminTypeDef> getTypeDefs(boolean p_refresh) throws BBjAdminException
      Get a set of all of the type definitions in the database. Specify true for p_refresh in order
      Parameters:
      p_refresh - Whether it should refresh the list of type definitions if there are any currently cached.
      Throws:
      BBjAdminException
    • getTypeDef

      BBjAdminTypeDef getTypeDef(String p_name) throws BBjAdminException
      Get an individual type definition in the database by name.
      Parameters:
      p_name - Name of typedef.
      Throws:
      BBjAdminException
    • createTypeDef

      BBjAdminTypeDef createTypeDef(String p_name) throws BBjAdminException
      Create an empty BBjAdminTypeDef object to be used for type definition creation.
      Parameters:
      p_name - Name of typedef.
      Throws:
      BBjAdminException
    • dropTable

      void dropTable(String p_name, boolean p_removeFiles) throws BBjAdminException
      Drop a single table. Optionally you can tell it to also remove the data file for the table as well.
      Parameters:
      p_name - Name of the table to drop.
      p_removeFiles - True if the data file for the table should also be removed. This includes .trigger files. Note: .sync and .textsearch files used for FULLTEXT index files will be removed regardless of whether this setting is true or false. If you do not want the FULLTEXT index files removed then use the other dropTable() method taking the additional p_removeFulltextFiles parameter.
      Throws:
      BBjAdminException
    • dropTable

      void dropTable(String p_name, boolean p_removeFiles, boolean p_removeFulltextFiles) throws BBjAdminException
      Drop a single table. Optionally you can tell it to also remove the data file and/or FULLTEXT index files for the table as well.
      Parameters:
      p_name -
      p_removeFiles - True if the data file for the table should also be removed. This includes .trigger files. Note: .sync and .textsearch files used for FULLTEXT index files will be only removed if the p_removeFulltextFiles parameter is true.
      p_removeFulltextFiles - True if the .sync and .textsearch files used for FULLTEXT index should be removed.
      Throws:
      BBjAdminException
    • dropTypeDef

      void dropTypeDef(String p_name) throws BBjAdminException
      Drop a single typedef.
      Parameters:
      p_name -
      Throws:
      BBjAdminException
    • getSequences

      Get a set of all of the sequences in the database.
      Throws:
      BBjAdminException
    • getSequence

      BBjAdminSequence getSequence(String p_name) throws BBjAdminException
      Get an individual sequence in the database by name.
      Parameters:
      p_name - Name of the sequence.
      Throws:
      BBjAdminException
    • createSequence

      BBjAdminSequence createSequence(String p_name) throws BBjAdminException
      Create an empty BBjAdminSequence object to be used for sequence creation.
      Parameters:
      p_name - Name of the sequence.
      Throws:
      BBjAdminException
    • dropSequence

      void dropSequence(String p_name) throws BBjAdminException
      Drop a single sequence.
      Parameters:
      p_name -
      Throws:
      BBjAdminException
    • getQueryAnalysis

      BBjAdminList<BBjAdminQueryAnalysis> getQueryAnalysis(int p_count) throws BBjAdminException
      Get a number of suggested indexes from query analysis.
      Parameters:
      p_count - Maximum number of suggested indexes to get.
      Throws:
      BBjAdminException
    • getQueryAnalysis

      BBjAdminList<BBjAdminQueryAnalysis> getQueryAnalysis(String p_tableFilter, int p_filterFlag, int p_count) throws BBjAdminException
      Get a filtered number of suggested indexes from query analysis.
      Parameters:
      p_count - Maximum number of suggested indexes to get.
      Throws:
      BBjAdminException
    • getDictionaryMigrationInfo

      BBjAdminDictionaryMigrationInfo getDictionaryMigrationInfo(String p_newDictionary, String p_dataLocation) throws BBjAdminException
      Returns information regarding the changes that may want to be made to the "new" dictionary when a call is made to updateDatabase(). The information in this object will tell what indexes and columns should be brought from the old dictionary to the new one, what SPROCs to bring forward, etc.
      Parameters:
      p_newDictionary - Location of new data dictionary definition that the database should match after update.
      p_dataLocation - Location where the table data files should be placed by the copy job during update.
      Throws:
      BBjAdminException
    • updateDatabase

      Takes the specified database and uses an online copy job to update its data files to match the definition in the newly specified database. All of the updated files will be placed in the p_destDir directory. The new dictionary will also be updated to match any information specified in the DictionaryMigrationInfo.
      Parameters:
      p_info -
      Throws:
      BBjAdminException
    • resolveGlobals

      String resolveGlobals(String p_string) throws BBjAdminException
      Takes the specified string and resolves any references to global values that are defined in this database definition. For example, (DATA) would be resolved to the path specified for the data files in the database.
      Parameters:
      p_string - String to be resolved.
      Throws:
      BBjAdminException
    • terminateAnalysisJobs

      void terminateAnalysisJobs(String p_database) throws BBjAdminException
      Suspends and removes all currently running table analysis jobs for the specified database.
      Parameters:
      p_database - Name of database to suspend all jobs for.
      Throws:
      BBjAdminException
    • getPrivileges

      BBjAdminList<BBjAdminPrivilege> getPrivileges(String p_userFilter, Integer p_privilegeType, Integer p_objectType, String p_objectIdFilter, String p_sortString) throws BBjAdminException
      Returns a list of all the privileges for the specified filter criteria. Use the p_sortString parameter to specify the order in which the privileges will be arranged. This operation reads all info from the disk each time.
      Parameters:
      p_userFilter - Use an SQL LIKE format filter value for the user or role name.
      p_privilegeType -
      p_objectType -
      p_objectIdFilter - Use an SQL LIKE format filter value for the object ID
      p_sortString - Specify column values and separate by commas. Valid values are DD_PRIVILEGE_TYPE, DD_OBJECT_TYPE, DD_OBJECT_ID, DD_USER_ID, DD_ROLE_ID, DD_WITH_GRANT
      Throws:
      BBjAdminException
    • setPrivileges

      void setPrivileges(int p_objectType, String p_objectId, BBjAdminList<BBjAdminPrivilege> p_privileges) throws BBjAdminException
      Convenience method to allow efficient setting of a large group of permissions in a single API call. Basically it will look through the list of permissions and grant or revoke permissions as necessary to match the list. Use caution as this updates the entire permission set for a particular object in the database.
      Parameters:
      p_objectType -
      p_objectId -
      p_privileges -
      Throws:
      BBjAdminException
    • grant

      void grant(List<BBjAdminPrivilege> p_privileges) throws BBjAdminException
      Grants the specified list of privileges for this database.
      Parameters:
      p_privileges -
      Throws:
      BBjAdminException
    • revoke

      void revoke(List<BBjAdminPrivilege> p_privileges) throws BBjAdminException
      Revokes the specified list of privileges from this database.
      Parameters:
      p_privileges -
      Throws:
      BBjAdminException
    • createPrivilege

      BBjAdminPrivilege createPrivilege()
      Returns a new instance of an empty BBjAdminPrivilege object ready to be set for granting or revoking privileges.
    • createRole

      void createRole(String p_roleName) throws BBjAdminException
      Creates a new role on the database used for grouping multiple users for the purpose of granting and revoking prvileges.
      Parameters:
      p_roleName -
      Throws:
      BBjAdminException
    • createRole

      void createRole(String p_roleName, String p_comments) throws BBjAdminException
      Creates a new role on the database used for grouping multiple users for the purpose of granting and revoking prvileges.
      Parameters:
      p_roleName -
      p_comments -
      Throws:
      BBjAdminException
    • dropRole

      void dropRole(String p_roleName) throws BBjAdminException
      Drops the specified role from the database.
      Parameters:
      p_roleName -
      Throws:
      BBjAdminException
    • getRoles

      Returns a list of all the names of the roles currently in the database.
      Throws:
      BBjAdminException
    • getRoleMembers

      BBjAdminList<String> getRoleMembers(String p_roleName) throws BBjAdminException
      Returns a list of the users who are currently part of the specified role.
      Parameters:
      p_roleName -
      Throws:
      BBjAdminException
    • executeSQL

      void executeSQL(String p_sql) throws BBjAdminException
      Executes an SQL statement or list of SQL statements separated by semi-colons.
      Parameters:
      p_sql -
      Throws:
      BBjAdminException
    • cleanupCaches

      void cleanupCaches()
      Called to explicitly clear out any cached data such as open connections to the database that were created internally by executing SQL statements on the database through calls to executeSQL(). If you want to clean things up before final cleanup, call this method.
    • getSanity

      Returns objects that contain information about the "sanity" of a particular database table. During table analysis, sanity is checked and if there are issues found with a table, information is logged to the DD_SANITY table about the nature of the problem. This is designed to help the administrator find problems in their database before customers do.
      Throws:
      BBjAdminException
    • getSanity

      BBjAdminTableSanity getSanity(String p_table) throws BBjAdminException
      Returns objects that contain information about the "sanity" of a particular database table. During table analysis, sanity is checked and if there are issues found with a table, information is logged to the DD_SANITY table about the nature of the problem. This is designed to help the administrator find problems in their database before customers do.
      Parameters:
      p_table - Name of the table to get the sanity information for.
      Throws:
      BBjAdminException
    • removeTableSanityMessage

      boolean removeTableSanityMessage(String p_sanityId) throws BBjAdminException
      Removes the specified alert message from the database sanity check table.
      Parameters:
      p_sanityId -
      Throws:
      BBjAdminException
    • getQueryData

      BBjAdminList<BBjAdminClientQueryData> getQueryData(String p_tableFilter) throws BBjAdminException
      Returns a list of BBjAdminQueryData objects, one for each table that matches the table filter criteria.
      Parameters:
      p_tableFilter -
      Throws:
      BBjAdminException
    • getDescriptiveProperties

      BBjAdminList<BBjAdminProperty> getDescriptiveProperties() throws BBjAdminException
      Used primarily by GUI applications like the Enterprise Manager to dynamically generate an admin UI. To get property values for general purposes, you should call the getXXX() methods.
      Returns:
      BBjAdminList containing BBjAdminProperty objects for each available property.
      Throws:
      BBjAdminException
    • getMetadataDefinition

      BBjAdminMetadataDefinition getMetadataDefinition() throws BBjAdminException
      Returns the definition for all the metadata in this database which includes database metadata, table, view, SPROC, etc.
      Throws:
      BBjAdminException
    • isUserProperty

      boolean isUserProperty(String p_property) throws BBjAdminException
      Returns true if the specified property is considered a user property which means it is not a standard built-in property for databases.
      Parameters:
      p_property -
      Throws:
      BBjAdminException
    • getStandardPropertyNames

      BBjAdminSet<String> getStandardPropertyNames() throws BBjAdminException
      Throws:
      BBjAdminException
    • close

      void close()
      Should be called when you are completely done with this instance to cleanup resources used on the server side.
    • getConnections

      Returns a list of all current connections made to this database. The connection info contains information such as the client's IP address, user, connect time, type of connection, number of statements open, number of transactions open (if transactional), etc.
      Returns:
      List of open connections on this database.
      Throws:
      BBjAdminException
    • export

      void export(String p_location, int p_format, List<String> p_tables, List<String> p_views, List<String> p_sprocs, List<String> p_types, List<String> p_sequences, List<String> p_users, List<String> p_roles) throws BBjAdminException
      Exports the database to the specified location in the specified format. Optionally, you may provide a list of each type of object to be exported such as table, views, SPROCs, etc.
      Parameters:
      p_location -
      p_format -
      p_tables - Null for all tables. Empty List for no tables. Populate the list with names of tables to include.
      p_views - Null for all views. Empty List for no views. Populate the list with names of views to include.
      p_sprocs - Null for all SPROCs. Empty List for no SPROCs. Populate the list with names of SPROCs to include.
      p_types - Null for all type definitions. Empty List for no type definitions. Populate the list with names of type definitions to include.
      p_sequences - Null for all sequences. Empty List for no sequences. Populate the list with names of sequences to include.
      p_users - Null for all users. Empty List for no users. Populate the list with names of users to include.
      p_roles - Null for all roles. Empty List for no roles. Populate the list with names of roles to include.
      Throws:
      BBjAdminException