From: R D. <rd...@cr...> - 2001-09-24 19:23:31
|
Guys, I am trying to create a pool of JDBC connections, storing them in a list called conlist. Here is the relevant snippet. 40 conlist= [] 41 for i in xrange(threadCount): 42 url = "jdbc:mysql://%s/%s?user=%s&password=%s" % (server, db, usr, passwd) 43 print "Connection # ",i 44 conlist[i]=DriverManager.getConnection(url) 45 sleep(0.5) It gives me the following error: Connection # 0 Traceback (innermost last): File "cxjdbcThread1.py", line 44, in ? IndexError: index out of range: -1 I must be making some very obvious mistake, but I can't find it. If there is a better (more efficient) way of storing the connection objects, pls tell me. Please help! Thanks Raj Datta Professional Services Direct : 408-530-4932 CrossAccess Corp Cell : 408-316-5473 2900 Gordon Ave #100 Fax : 408-735-0328 Santa Clara CA 95051 Email : rd...@cr... |