DBVIEW
org.dbview.input_addons.AbstractLoader Class Reference
Collaboration diagram for org.dbview.input_addons.AbstractLoader:

List of all members.

Public Member Functions

Database load (Element in_profile) throws Exception

Protected Member Functions

abstract
AbstractSotfForeignKeyDetector 
_getSoftForeignKeyDetector_ (Element in_profile) throws Exception
abstract String _getUrl_ (Element in_data) throws Exception
ArrayList< String > _tables (Connection in_connection, DatabaseMetaData in_db_meta) throws Exception
Hashtable< String, DbIndex_indexes (Connection in_connection, DatabaseMetaData in_db_meta, Table in_table) throws Exception
ArrayList< String > _primary (Connection in_connection, DatabaseMetaData in_db_meta, Table in_table) throws Exception
ArrayList< DbForeignKey_foreign (Connection in_connection, DatabaseMetaData in_db_meta, Table in_table) throws Exception
ArrayList< String > _fields (Connection in_connection, DatabaseMetaData in_db_meta, Table in_table) throws Exception
ArrayList< String > _null (Connection in_connection, DatabaseMetaData in_db_meta, Table in_table) throws Exception

Private Attributes

Connection __connection = null
DatabaseMetaData __db_meta = null

Detailed Description

This class implements the database loader adaptor.

Please note that the exploration of the database relies on JDBC type 4.

Child classes may override the methods, if a specific database needs specific procedures.

Author:
Denis Beurive

Definition at line 40 of file AbstractLoader.java.


Member Function Documentation

ArrayList<String> org.dbview.input_addons.AbstractLoader._fields ( Connection  in_connection,
DatabaseMetaData  in_db_meta,
Table  in_table 
) throws Exception [protected]

This method returns the list of all fields for a given table.

Parameters:
in_connectionConnection to the database.
in_db_metaMeta data associated to the database.
in_tableThe table.
Returns:
The method returns the list of all fields for the given table.
Exceptions:
Exception

Definition at line 182 of file AbstractLoader.java.

Referenced by org.dbview.input_addons.AbstractLoader.load().

ArrayList<DbForeignKey> org.dbview.input_addons.AbstractLoader._foreign ( Connection  in_connection,
DatabaseMetaData  in_db_meta,
Table  in_table 
) throws Exception [protected]

This method returns the list of all foreign keys for a given table.

Parameters:
in_connectionConnection to the database.
in_db_metaMeta data associated to the database.
in_tableThe table.
Returns:
The method returns the list of all foreign keys for the given table. Each element of the returned list is an array that contains 2 elements.
  • First element: The name of the foreign key, within the given table.
  • Second element: The name of the field, within the target table.
Exceptions:
Exception

Definition at line 157 of file AbstractLoader.java.

Referenced by org.dbview.input_addons.AbstractLoader.load().

abstract AbstractSotfForeignKeyDetector org.dbview.input_addons.AbstractLoader._getSoftForeignKeyDetector_ ( Element  in_profile) throws Exception [protected, pure virtual]

This method returns an instance of a soft foreign key detector (if it is defined in the profile).

Parameters:
in_profileProfile used to open a connexion to the database through the input add-on.
Returns:
The method returns an instance of a soft foreign key detector, or null if no detector is defined.

Referenced by org.dbview.input_addons.AbstractLoader.load().

abstract String org.dbview.input_addons.AbstractLoader._getUrl_ ( Element  in_data) throws Exception [protected, pure virtual]

This method returns the URL used to open a connection to the database.

Parameters:
in_dataXML element that contains the data required to open the connection.
Returns:
The method returns the URL used to open a connection to the database.
Exceptions:
Exception

Referenced by org.dbview.input_addons.AbstractLoader.load().

Hashtable<String, DbIndex> org.dbview.input_addons.AbstractLoader._indexes ( Connection  in_connection,
DatabaseMetaData  in_db_meta,
Table  in_table 
) throws Exception [protected]

This method returns the list of all indexes for a given table. It also set the table's list of indexes.

Parameters:
in_connectionConnection to the database.
in_db_metaMeta data associated to the database.
in_tableThe table.
Returns:
The method returns the list of all indexes for the given table.
Exceptions:
Exception

Definition at line 92 of file AbstractLoader.java.

Referenced by org.dbview.input_addons.AbstractLoader.load().

ArrayList<String> org.dbview.input_addons.AbstractLoader._null ( Connection  in_connection,
DatabaseMetaData  in_db_meta,
Table  in_table 
) throws Exception [protected]

This method returns the list of fields that can be null for a given table.

Parameters:
in_connectionConnection to the database.
in_db_metaMeta data associated to the database.
in_tableThe table.
Returns:
Thie method returns the list of fields that can be null.
Exceptions:
Exception

Definition at line 198 of file AbstractLoader.java.

Referenced by org.dbview.input_addons.AbstractLoader.load().

ArrayList<String> org.dbview.input_addons.AbstractLoader._primary ( Connection  in_connection,
DatabaseMetaData  in_db_meta,
Table  in_table 
) throws Exception [protected]

This method returns the primary key for a given table.

Parameters:
in_connectionConnection to the database.
in_db_metaMeta data associated to the database.
in_tableThe table.
Returns:
  • The method returns the name of the primary key, if the table defines a primary key.
  • If the method does not define any primary key, then the method returns the value null.
Exceptions:
Exception

Definition at line 136 of file AbstractLoader.java.

Referenced by org.dbview.input_addons.AbstractLoader.load().

ArrayList<String> org.dbview.input_addons.AbstractLoader._tables ( Connection  in_connection,
DatabaseMetaData  in_db_meta 
) throws Exception [protected]

This method returns the list of all tables in the database.

Parameters:
in_connectionConnection to the database.
in_db_metaMeta data associated to the database.
Returns:
The method returns the list of all tables in the database.
Exceptions:
Exception

Definition at line 75 of file AbstractLoader.java.

Referenced by org.dbview.input_addons.AbstractLoader.load().

Database org.dbview.input_addons.AbstractLoader.load ( Element  in_profile) throws Exception

This method loads information from a given database and returns a model of the database.

Parameters:
in_profileProfile associated to the database (<data>...</data>).
Returns:
The method returns a model of the database.
Exceptions:
Exception

Definition at line 216 of file AbstractLoader.java.


Member Data Documentation

Handler to the database's connection.

Definition at line 45 of file AbstractLoader.java.

Referenced by org.dbview.input_addons.AbstractLoader.load().

DatabaseMetaData org.dbview.input_addons.AbstractLoader.__db_meta = null [private]

This attribute contains the "meta data" for the current database.

See also:
JDBC for details.

Definition at line 51 of file AbstractLoader.java.

Referenced by org.dbview.input_addons.AbstractLoader.load().


The documentation for this class was generated from the following file: