Database Toolbox    

Performing Driver Functions

This part of the tutorial demonstrates how to create database driver and drivermanager objects so that you can get and set the object properties. You use these Database Toolbox functions:

There is no equivalent M-file demo to run because the tutorial uses a PC and relies on a specific JDBC connection and database; your configuration will be different.

  1. Use the driver function to construct a driver object for a specified database URL string of the form jdbc:<subprotocol>:<subname>. For example, type

    MATLAB returns the handle (identifier) for the driver object.

  1. To get properties of the driver object, type

    MATLAB returns information about the driver's versions.

  1. To determine if d is a valid JDBC driver object, type

    MATLAB returns

    which means d is a valid JDBC driver object. Otherwise, MATLAB would have returned a 0.

  1. To set and get properties for all drivers, first create a drivermanager object using the drivermanager function. Type

    dm is the drivermanager object.

  1. Get properties of the drivermanager object. Type

    MATLAB returns

  1. To set the LoginTimeout value to 10 for all drivers loaded during this session, type

    Verify the value by typing

    MATLAB returns

    If you now connect to a database, the LoginTimeout value will be 10. For example, type

    MATLAB returns

For a list of all the driver object functions you can perform, type


 Accessing Metadata Working with Cell Arrays in MATLAB