File Exchange

image thumbnail

Database Handler

version 1.0 (3.12 KB) by

Read, Insert, Delete, Update and execute Sql Queries from a database source.

1 Download

Updated

View License

This class abstracts database standard operations into a MATLAB class. All that is required is a correctly formatted connection string. The class uses under the hood the database machinery of the .NET framework.

Query results are encapsulated into MATLAB datasets for an efficient usage of the retrieved data tables.

Usage:

dbHanldler = DatabaseHandler(connectionString);

Retrieving Table Data Example:

tableDataset = dbHandler.SelectAll('TableName');

Comments and Ratings (3)

Dennis

Dennis (view profile)

Hi Fayassal,
any chance you could point me in the right direction for modifying the database handler to output to a structure? I'm new to matlab, so any help is appreciated.

Thanks,
Dennis

Hi Gavin,

That is true! The output will be accustomed to a Dataset. Unfortunately, the Dataset Data Type is part of the Statistics toolbox. I hope Mathworks would integrate the feature also in basic MATLAB. The database handler could be also modified to output a cell array or a structure.

Best regards,
Fayssal

Gavin

Gavin (view profile)

Tried to use this, and I am having problems. Looks to use the 'dataset' command from the Statistics toolbox, which I don't have.

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video