view m-toolbox/test/test_jmysql/test1.m @ 2:18e956c96a1b database-connection-manager

Add LTPDADatabaseConnectionManager implementation. Matlab code
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Sun, 04 Dec 2011 21:23:09 +0100
parents f0afece42f48
children
line wrap: on
line source


mc

%% Various tests


conn = utils.jmysql.connect('localhost', 'ltpda_test', 'hewitson', 'asd');

q = 'select * from objmeta';

[resultSet, cols] = utils.jmysql.query(conn, q);

[results, cols] = utils.jmysql.resultsToCell(resultSet);

utils.jmysql.displayResults(resultSet, q);

utils.jmysql.queryDialog(conn)

%% Close connection

conn.closeConnection

%% Show query builder 

utils.jmysql.queryDialog()

%% Converters

conn = utils.jmysql.connect('localhost', 'ltpda_test', 'hewitson', 'asd');

dbconn = utils.jmysql.jconnTodbconn(conn)

conn.closeConnection

jconn = utils.jmysql.dbconnTojconn(dbconn)

close(dbconn)

jconn.closeConnection

%% Show submit dialog

sinfo = utils.jmysql.submitDialog
close(sinfo.conn)

%% Show submit dialog with a valid connection

conn = utils.jmysql.connect('localhost', 'ltpda_test', 'hewitson', 'asd');
sinfo = utils.jmysql.submitDialog(conn)
conn.closeConnection
close(sinfo.conn)

%% Show submit dialog with an input sinfo

conn = utils.jmysql.connect('localhost', 'ltpda_test', 'hewitson', 'asd');
sinfo = utils.jmysql.submitDialog(conn)
sinfo = utils.jmysql.submitDialog(conn, sinfo)
conn.closeConnection
close(sinfo.conn)