From Eigenvector Research Documentation Wiki
Revision as of 22:03, 13 June 2013 by imported>Scott (Connection Methods)
Jump to navigation Jump to search


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.

The general workflow of using a EVRIDB object:

  • Set connection attributes.
  • Test the connection.
  • Set query properties.
  • Run queries.

Connection Properties


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

  • access - Microsoft Access database.
  • mssql - Microsoft SQL Server.
  • mysql - MySQL database (Windows).
  • dsn - Microsoft database (Data Source Name).

JDBC Connections

  • jmysql - MySQL database(JDBC).
  • oracle - Oracle database.
  • derby - Derby (JavaDB) local database.

Custom Connections

  • generic - Custom type connection.


Folder containing database file (on local file system).


Depending on type of database, create database is not already.


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 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.


JDBC driver jar file location. This is added to the dynamic class path in Matlab.


Only used by ADODB object so this will always be 'MSDASQL'.


Use user authentication when making connection, must provide .username and .pw.


User to connect as.


Password to connect as.


Whether or not to use database encryption (derby).


Hash key for encryption.


IP address for database (default location is 'localhost').


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.


Connection port number.


Sub structure of additional arguments. This value must be a sting of exactly what is required in the database connection string.


Sub structure of additional arguments. This value must be a sting of exactly what is required in the database connection string.

Query Properties


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


[{'cell'} 'dso']Specify how to return data, as DSO or Cell array.


['yes' 'no'] If return type = DSO, try to use column names as variable names in the DSO or the first row if cell output.


['on' 'off' {'auto'}] Show a waitbar when parsing jdbc record sets, 'auto' is set to show if larger than 1000 records.


[{1} 0] Interpret null values in a numeric column as NaN. Set to 0 to help speed up query parsing.

Connection Methods


Get connection object.


Test database connection.


Close database connection


Close connection even if it's persistent.


Try a graceful shutdown of Derby.

Query Methods