Mercurial > hg > ltpda
diff m-toolbox/classes/tests/database/@ltpda_database/executeQuery.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children | 79dc7091dbbc |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/tests/database/@ltpda_database/executeQuery.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,22 @@ +% +% DESCRIPTION: Returns the result for a given query. +% +% VERSION: $Id: executeQuery.m,v 1.1 2011/05/25 16:20:25 ingo Exp $ +% +function val = executeQuery(utp, query) + + utp.conn.setLocked(true); + utp.conn.openConnection(); + c = utp.conn.getConn(); + + try + val = utils.jmysql.execute(c, query); + catch Me + utp.conn.setLocked(false); + utp.conn.closeConnection(); + rethrow(Me); + end + + utp.conn.setLocked(false); + utp.conn.closeConnection(); +end