meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
applications:connect_matlab_mac [2022/05/26 21:39] gregbalcoapplications:connect_matlab_mac [2022/05/26 22:24] (current) gregbalco
Line 54: Line 54:
 == Connecting MATLAB to the database through the SSH tunnel ==  == Connecting MATLAB to the database through the SSH tunnel == 
  
-Now that you have an ssh tunnel open to the database, you need to point MATLAB to it. On current MATLAB, it appears the easiest way to do this is to use the 'JDBC data source configuration' dialog that you have already opened. What this does is create a persistent description of a database connection that you can refer to by name from the command line. So, for example, this:+Now that you have an ssh tunnel open to the database, you need to point MATLAB to it. On current MATLAB, it appears the easiest way to do this is to use the 'JDBC data source configuration' dialog, which can be opened from the 'Database explorer' as indicated in the MATLAB help described above, or can be invoked from the MATLAB command line by typing 'configureJDBCDataSource.What this does is create a persistent description of a database connection that you can refer to by name from the command line. So, for example, this:
  
 {{:applications:screen_shot_2022-05-26_at_1.57.28_pm.png?400|}} {{:applications:screen_shot_2022-05-26_at_1.57.28_pm.png?400|}}
Line 66: Line 66:
 ''dbc = database('new_ICED_reader_through_tunnel','reader','beryllium-10')'' ''dbc = database('new_ICED_reader_through_tunnel','reader','beryllium-10')''
  
-This should return a bunch of information about the database connection. You now have a live connection to the database that can be accessed in a MATLAB script. Try:+This should return a bunch of information about the database connection. You now have a live connection to the database that can be accessed by additional MATLAB commands. Try:
  
 ''query_result = fetch(dbc,'select name,lat_DD,lon_DD from base_sample where name = "10-MPS-001-COU"')'' ''query_result = fetch(dbc,'select name,lat_DD,lon_DD from base_sample where name = "10-MPS-001-COU"')''