view m-toolbox/test/test_jmysql/test1.m @ 30:317b5f447f3e database-connection-manager

Update workspaceBrowser
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +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)