install_jconnector, which should be run from the main hctsa directory. If this script runs successfully and a mySQL server has been installed (either on your local machine or on an external server, see above), you are then ready to run the
install_jconnectorscript (including instructions on how to perform the steps manually):
mysql-connector-java-5.1.35-bin.jar(for version 5.1.35). Instructions are here and are summarized below, and described in the Matlab documentation. This .jar file must be added to a static path where it can always be found by Matlab. A good candidate directory is the java/jarext/ subdirectory of the Matlab root directory (to determine the Matlab root directory, simply type
matlabrootin an open Matlab command window).
prefdirin a command window, or navigate to it within Matlab using
install.mscript, which runs the user through the steps below.
SQL_create_dbfunction. This requires that mySQL is installed on an accessible server, or on the local machine (i.e., using
localhost). If the database has already been set up, then you do not need to use the
SQL_create_dbfunction but you must then create a text file,
sql-setting.conf, in the Database directory of the repository. This file contains four comma-delimited entries corresponding to the server name, database name, username, and password, as per the following:
SQL_CloseDatabase. An example usage is as follows:
dbc = SQL_OpenDatabase;and
SQL_CloseDatabase(dbc)without errors, then you can smile to yourself and you should at this point be happy because Matlab can communicate successfully with your mySQL server! You should also be excited because you are now ready to set up the database structure!
localhost), then Matlab can communicate with a mySQL server through an ssh tunnel, which requires some additional setup (described below).
SQL_OpenDatabasefunction uses Matlab's Database Toolbox if a license is available, but otherwise will use java commands; both are supported and should give identical operational behavior.
SQL_ChangeDatabasescript (which walks you through the steps and writes over the existing sql_settings.conf file), or by altering the sql_settings.conf file directly.
%to the start of a line to comment it out).
localhostthrough port 1234 will connect it, through the established ssh tunnel, to the server. This can be achieved by specifying the server as
localhostand the port number as 1234 in the sql_settings.conf file (or during the
installprocess), which can be specified as the (optional) fifth entry, i.e.,: