Permalink
Browse files

finished assignment part 3

  • Loading branch information...
remyb committed Feb 28, 2010
1 parent 04e5312 commit b52381eb5519f321430662e8ae615cac46b2ad04
Showing with 9 additions and 6 deletions.
  1. +3 −3 main.py
  2. +1 −1 part1.py
  3. +5 −1 part3.py
  4. +0 −1 sqlfile
View
@@ -68,9 +68,9 @@ def readDDL(fileName):
f.close()
# Prints the contents of the Query
-def print_table(conn, column, table):
- sql = "SELECT " + column + " FROM " + table + ";"
- print sql
+def print_results(conn,sql):
+ #sql = "SELECT " + column + " FROM " + table + ";"
+ #print sql
stmt = ibm_db.exec_immediate(conn,sql)
dictionary = ibm_db.fetch_assoc(stmt)
while dictionary != False:
View
@@ -41,7 +41,7 @@
insert_catalog_row(query, cat, node1)
elif node is db2:
insert_catalog_row(query, cat, node2)
-
+
# close persistant connections
for node in nodes:
ibm_db.close(node)
View
@@ -4,7 +4,7 @@
from main import *
from antlr import *
from ConfigExtractor import ConfigExtractor
-
+from threading import Thread
if len(sys.argv) is not 3:
print "[*] Usage: python part3.py [temp.cfg] [sqlfile] - see README for config format"
@@ -31,6 +31,10 @@
print node
print "[*] Placing connections into a list..."
connections.append(ibm_db.pconnect(node[0], node[1],node[2]))
+for query in lines:
+ print "processing this query: ", query
+ for database in connections:
+ Thread(target=print_results,args=(database,query,)).start()
View
@@ -1,2 +1 @@
-select * from BOOKST;
select * from BOOKS;

0 comments on commit b52381e

Please sign in to comment.