Package xal.plugin.mysql
Class MySQLDatabaseAdaptor
java.lang.Object
xal.tools.database.DatabaseAdaptor
xal.plugin.mysql.MySQLDatabaseAdaptor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfetchAllSchemas
(Connection connection) Fetch all schemas from the connected database.getArray
(String type, Connection connection, Object array) Get an SQL Array given an SQL array type, connection and a primitive arraygetColumnsResultSet
(DatabaseMetaData metaData, String schema, String table) Get the result set of columns for the specified meta data, schema and table.getConnection
(String urlSpec, String user, String password) Get a new database connectiongetPrimaryKeysResultSet
(DatabaseMetaData metaData, String schema, String table) Get the result set of primary keys for the specified meta data, schema and table.getTablesResultSet
(DatabaseMetaData metaData, String schema) Get the result set for tables for the specified meta data and schema.Methods inherited from class xal.tools.database.DatabaseAdaptor
fetchNontrivialSchemas, fetchPrimaryKeys, fetchTables, getConnection, getInstance, newBlob
-
Constructor Details
-
MySQLDatabaseAdaptor
public MySQLDatabaseAdaptor()
-
-
Method Details
-
getArray
Description copied from class:DatabaseAdaptor
Get an SQL Array given an SQL array type, connection and a primitive array- Specified by:
getArray
in classDatabaseAdaptor
- Parameters:
type
- An SQL array type identifying the type of arrayconnection
- An SQL connectionarray
- The primitive Java array- Returns:
- the SQL array which wraps the primitive array
- Throws:
DatabaseException
- if a database exception is thrown
-
getConnection
public Connection getConnection(String urlSpec, String user, String password) throws DatabaseException Description copied from class:DatabaseAdaptor
Get a new database connection- Overrides:
getConnection
in classDatabaseAdaptor
- Parameters:
urlSpec
- The URL to which to connectuser
- The user login into the databasepassword
- the user's password- Throws:
DatabaseException
- if a database exception is thrown
-
fetchAllSchemas
Fetch all schemas from the connected database. MySQL adaptor returns catalogs instead of schemas.- Overrides:
fetchAllSchemas
in classDatabaseAdaptor
- Returns:
- list of all schemas in the database
- Throws:
DatabaseException
DatabaseException
- if the schema fetch fails
-
getTablesResultSet
Get the result set for tables for the specified meta data and schema. MySQL adaptor uses the catalog in place of schema.- Overrides:
getTablesResultSet
in classDatabaseAdaptor
- Throws:
SQLException
-
getColumnsResultSet
public ResultSet getColumnsResultSet(DatabaseMetaData metaData, String schema, String table) throws SQLException Get the result set of columns for the specified meta data, schema and table. MySQL adaptor uses the catalog in place of schema.- Overrides:
getColumnsResultSet
in classDatabaseAdaptor
- Throws:
SQLException
-
getPrimaryKeysResultSet
public ResultSet getPrimaryKeysResultSet(DatabaseMetaData metaData, String schema, String table) throws SQLException Get the result set of primary keys for the specified meta data, schema and table. MySQL adaptor uses the catalog in place of schema.- Overrides:
getPrimaryKeysResultSet
in classDatabaseAdaptor
- Throws:
SQLException
-