Mercurial > hg > ltpda
diff m-toolbox/classes/tests/database/@ltpda_database/getDataIdFromAoTable.m @ 25:79dc7091dbbc database-connection-manager
Update tests
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line diff
--- a/m-toolbox/classes/tests/database/@ltpda_database/getDataIdFromAoTable.m Mon Dec 05 16:20:06 2011 +0100 +++ b/m-toolbox/classes/tests/database/@ltpda_database/getDataIdFromAoTable.m Mon Dec 05 16:20:06 2011 +0100 @@ -5,20 +5,8 @@ % VERSION: $Id: getDataIdFromAoTable.m,v 1.1 2011/05/25 16:23:53 ingo Exp $ % function val = getDataIdFromAoTable(utp, objID) - - utp.conn.setLocked(true); - utp.conn.openConnection(); - c = utp.conn.getConn(); - - q = sprintf('SELECT data_id FROM ao WHERE ao.obj_id=%d', objID); - try - val = utils.jmysql.execute(c, q); - catch Me - utp.conn.setLocked(false); - utp.conn.closeConnection(); - rethrow(Me); - end - - utp.conn.setLocked(false); - utp.conn.closeConnection(); + + q = sprintf('SELECT data_id FROM ao WHERE ao.obj_id = ?'); + val = utils.mysql.execute(utp.conn, q, objID); + end