How to connect to Oracle database and run SQL queries from matlab command line and database explorer App?

In this video it shows the steps to configure the Oracle database in the matlab environment using the database explorer. The it shows how one run a query on the connected database through the database explorer or Matlab commands/ script.

In this video it initially shows the result of connecting to the database through the Windows command prompt using sqlplus command.

I hope you like this video. For any questions, suggestions or appreciation please contact us at: or email at:

Complete source code and other details:

connection = database("Oracle_Local", "CTXSYS", "CTXSYS");

Query = "select table_name from user_tables fetch first 10 rows only";

data = fetch(connection, Query)



>> Oracle_Database_Query

data =

  10×1 table


    {'DR$PARAMETER'           }
    {'DR$CLASS'               }
    {'DR$OBJECT'              }
    {'DR$PREFERENCE'          }
    {'DR$INDEX'               }
    {'DR$INDEX_VALUE'         }

Steps to configure the database using the Explorer App:

Configuration saved:

To configure the above using command line, use below command:

conn = database('','CTXSYS','CTXSYS', ...
    'Vendor','Oracle', ...
    'driver', 'C:\Work\matlab\OracleDatabaseApp\ojdbc14.jar', ...
    'URL',['jdbc:oracle:thin:@(DESCRIPTION = ' ...
    '(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)' ...
    '(PORT = 1521)) (CONNECT_DATA = ' ...

Connection details and steps also available on:

Then choose “Manual” option to enter the query manually and “Preview Query”:

JAR File:

Oracle Database installation steps are available in the below link:

Leave a Reply

%d bloggers like this:
Available for Amazon Prime