Changeset 31225 for trunk/ippToPsps/jython/ipptopspsdb.py
- Timestamp:
- Apr 6, 2011, 10:26:37 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/ipptopspsdb.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/ipptopspsdb.py
r31198 r31225 4 4 import sys 5 5 import os 6 import logging 6 7 7 8 from java.sql import * … … 19 20 20 21 ''' 21 def __init__(self ):22 def __init__(self, logger): 22 23 24 # setup logging 25 self.logger = logger 26 self.logger.debug("IppToPspsDb Constructor") 23 27 # open config 24 28 doc = ElementTree(file="config.xml") … … 38 42 def createNewBatch(self, expID, surveyType, batchType, dvoDb, datastoreProduct): 39 43 40 print "Creating nw batch in ippToPsps database"41 44 sql = "SELECT batch_id FROM batches ORDER BY batch_id DESC LIMIT 1" 42 45 … … 48 51 batchID = rs.getInt(1) 49 52 except: 50 print "Unable to get batch ID"53 self.logger.exception("Unable to get batch ID") 51 54 52 55 if batchID > 0: … … 70 73 self.stmt.execute(sql) 71 74 75 self.logger.info("Creating new batch in ippToPsps database with batchID = %d" % batchID) 76 72 77 return batchID; 73 78 … … 77 82 def __del__(self): 78 83 79 print "IppToPspsDb destructor"84 self.logger.debug("IppToPspsDb Desstructor") 80 85 self.stmt.close() 81 86 self.con.close()
Note:
See TracChangeset
for help on using the changeset viewer.
