- Timestamp:
- Sep 6, 2011, 11:00:22 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110710/ippToPsps/jython
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110710/ippToPsps/jython
-
Property svn:ignore
set to
*.class
-
Property svn:ignore
set to
-
branches/eam_branches/ipp-20110710/ippToPsps/jython/mysql.py
r31844 r32337 36 36 # set up JDBC connection 37 37 self.url = "jdbc:mysql://"+self.dbHost+"/"+self.dbName+"?user="+self.dbUser+"&password="+self.dbPass 38 self.con = DriverManager.getConnection(self.url) 39 self.connectionID = self.getLastConnectionID() 40 self.logger.debug("MySQL connection to %s with ID %d" % (dbType, self.connectionID)) 41 42 #self.stmt = self.con.createStatement() 38 try: 39 self.con = DriverManager.getConnection(self.url) 40 self.connectionID = self.getLastConnectionID() 41 self.logger.debug("MySQL connection to %s with ID %d" % (dbType, self.connectionID)) 42 except: 43 self.logger.error("Unable to connect to " + self.url) 44 self.everythingOK = False 45 return 46 47 self.everythingOK = True 43 48 44 49 … … 210 215 nBad = rs.getInt(1) 211 216 212 sql="DELETE from " + tableName + " WHERE " + columnName + " = " + value 213 self.execute(sql) 214 self.logger.info("%s '%s' values in %s %5d deleted" % (columnName, value, tableName, nBad)) 217 sql="DELETE FROM " + tableName + " WHERE " + columnName + " = " + value 218 self.execute(sql) 219 self.logger.debugPair("%s rows with %s" % (columnName, value), "%d deleted" % nBad) 220 221 return nBad 215 222 216 223 ''' … … 224 231 nBad = rs.getInt(1) 225 232 226 sql="DELETE from " + tableName + " WHERE " + columnName + " IS NULL" 227 self.execute(sql) 228 self.logger.infoPair("NULLs deleted from %s" % tableName, "%-5d %s" % (nBad, columnName)) 233 sql="DELETE FROM " + tableName + " WHERE " + columnName + " IS NULL" 234 self.execute(sql) 235 self.logger.debugPair("NULL %s values" % columnName, "%d deleted" % nBad) 236 237 return nBad 229 238 230 239 '''
Note:
See TracChangeset
for help on using the changeset viewer.
