Issue625362

classification
Title: java importing from jars on sys.path
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pedronis Nosy List: cgroves, pedronis
Priority: low Keywords:

Created on 2002-10-18.19:04:10 by pedronis, last changed 2006-09-07.04:51:50 by cgroves.

Messages
msg762 (view) Author: Samuele Pedroni (pedronis) Date: 2002-10-18.19:04:10
https://sourceforge.net/mailarchive/forum.php?
thread_id=1134352&forum_id=5586 :


Can anyone explain this sys.path jar import behavior?  
I'm don't want to
 require the jar on the classpath.
 
 
 >>> 	import sys
 >>> 	sys.path.append('C:\\Program 
Files\\Apache Tomcat
 4.0\\lib\\classes12.jar')
 >>> 	sys.add_package('oracle.jdbc.driver')
 <java package oracle.jdbc.driver at 5933694>
 
 ### Everything is fine up to this point, now try to get 
the OracleDriver
 class
 
 >>> 	from oracle.jdbc.driver import OracleDriver
 Traceback (most recent call last):
 ImportError: cannot import name OracleDriver
 
 ### Why is this? If I do dir(oracle.jdbc.driver) I can 
see 'OracleDriver'...
 
 ### But anyway, for some reason this works
 
 >>> 	from oracle.jdbc.driver import *
 >>> 	OracleDriver
 <jclass oracle.jdbc.driver.OracleDriver at 3086613>
 
 ### And BTW, now this doesn't throw any errors.
 
 >>> 	from oracle.jdbc.driver import OracleDriver
 >>> 	
 

msg763 (view) Author: Charlie Groves (cgroves) Date: 2006-09-07.04:51:50
Logged In: YES 
user_id=1174327

sys.path.append(jarfile)
import <specific class from jarfile>

works in trunk now.
History
Date User Action Args
2002-10-18 19:04:10pedroniscreate