(self, statement)
| 35 | database=self.db) |
| 36 | |
| 37 | def execute(self, statement): |
| 38 | txn = None |
| 39 | try: |
| 40 | txn = self.connect() |
| 41 | cursor = txn.cursor() |
| 42 | cursor.execute(statement) |
| 43 | cursor.close() |
| 44 | txn.commit() |
| 45 | if txn is not None: |
| 46 | try: |
| 47 | txn.close() |
| 48 | except: |
| 49 | pass |
| 50 | except: |
| 51 | raise CloudRuntimeException("Failed to execute: %s " % statement) |
| 52 | finally: |
| 53 | if txn is not None: |
| 54 | try: |
| 55 | txn.close() |
| 56 | except: |
| 57 | pass |
| 58 | |
| 59 | def testConnection(self): |
| 60 | try: |