Evridb
Contents |
Introduction
EVRIDB Objects provide connection and query capability for many types of databases. For MySQL, ODBC, and JavaDB databases EVRIDB objects work with no special preparations. For other databases a JDBC Driver will be necessary. The object can return a cell array of values (with a mix of datatypes) or a DataSet Object .
This object is not heavily maintained for all database types. For a more extensive set of database tools see The MathWorks Database Toolbox.
Examples of creating and using objects here.
The general workflow of using a EVRIDB object:
- Set connection attributes.
- Test the connection.
- Set query properties.
- Run queries.
Connection Properties
.type |
Type of connection (e.g., 'access' 'mysql' mssql') Determines what driver is used. When set, default values will be added to .provider, .driver, and .driver_jar_file where appropriate.
Microsoft Windows Connections
JDBC Connections
Custom Connections
|
.location |
Folder containing database file (on local file system). |
.create |
Depending on type of database, create database is not already. |
.persistent |
Do not close connection object after creation or query, stored (in appdata 0). When calling multiple times this can help reduce time to return results. |
.driver |
Driver to be used for connection (these must be currently installed on the machine, use the ODBC Manager from Administrative Tools to view currently available drivers on a Windows machine. JDBC must have driver location in .driver_jar_file. |
.driver_jar_file |
JDBC driver jar file location. This is added to the dynamic class path in Matlab. |
.provider |
Only used by ADODB object so this will always be 'MSDASQL'. |
.use_authentication |
Use user authentication when making connection, must provide .username and .pw. |
.username |
User to connect as. |
.pw |
Password to connect as. |
.use_encryption |
Whether or not to use database encryption (derby). |
.encryption_hash |
Hash key for encryption. |
.server |
IP address for database (default location is 'localhost'). |
.dsn |
Data Source Name (set up on local computer using ODBC Manager from Administrative Tools). If the database connection remains static, this can be a simple way to manage the connection. See the "ODBC" topic in Windows help for more information on DSN. |
.port |
Connection port number. |
.arguments.name |
Sub structure of additional arguments. This value must be a sting of exactly what is required in the database connection string. |
.arguments.value |
Sub structure of additional arguments. This value must be a sting of exactly what is required in the database connection string. |
Query Properties
.sql_string |
Returns the short "keyword" model type of the current model (or empty string if the model type has not been set). This keyword most often is linked to the PLS_Toolbox function that created the given model. This can be assigned to any model type listed in the |
.return_type |
[{'cell'} 'dso']Specify how to return data, as DSO or Cell array. |
.use_column_names |
['yes' 'no'] If return type = DSO, try to use column names as variable names in the DSO or the first row if cell output. |
.query_watibar |
['on' 'off' {'auto'}] Show a waitbar when parsing jdbc record sets, 'auto' is set to show if larger than 1000 records. |
.null_as_nan |
[{1} 0] Interpret null values in a numeric column as NaN. Set to 0 to help speed up query parsing. |
Connection Methods
.getconnection |
Get connection object. |
.test |
Test database connection. |
.close |
Close database connection |
.closeconnection_force |
Close connection even if it's persistent. |
.shutdown_derby |
Try a graceful shutdown of Derby. |
Query Methods
.runquery |
Run query. |
.ms_get_last |
Try to get last id from auto-increment ID value. |
.get_tables |
Get table names from ADO. |