
from openDB import *

scon=protocol+dbName+';create=false'
conn = DriverManager.getConnection(scon,props)
s = conn.createStatement()

s1='SELECT num, addr FROM '+table+' ORDER BY num'
rs = s.executeQuery(s1)
while rs.next():
  print 'sorted='+rs.getString(1),rs.getString(2)
     
s2 = 'SELECT * FROM '+table+' WHERE addr=\'Union St.\''
rs = s.executeQuery(s2)
while rs.next():
  print 'Found=',rs.getString(1),rs.getString(2)

s.close()
conn.commit()

try:
 DriverManager.getConnection('jdbc:derby:;shutdown=true')
except SQLException:
 print 'all done'
