Connect WAI Database to Matlab

In order for Matlab to access the database, it is necessary to download a JDBC driver, which will be the bridge between Matlab and the database. The link to download the driver can be found here.

Screen Shot 2016-09-22 at 3.26.28 PM

Once you’ve downloaded the folder, put the folder (it should be called something similar to “mysql-connector-java-5.1.39”) in a location you can easily reach and remember.

Open the Matlab code called GraphUsingJDBC. Now you need to establish the connection between Matlab and the database. Where it says

javaaddpath ‘/Users/vosslab/Desktop/mysql-connector-java-5.1.39/mysql-connector-java-5.1.39-bin.jar’,

change the directory so that it matches where you’ve saved the JDBC driver folder. Now if you run the code, it will make the connection to the database and graph the data you desire.