From: <no...@so...> - 2002-10-18 19:04:10
|
Bugs item #625362, was opened at 2002-10-18 21:04 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=625362&group_id=12867 Category: Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Samuele Pedroni (pedronis) Assigned to: Samuele Pedroni (pedronis) Summary: java importing from jars on sys.path Initial Comment: 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 >>> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=625362&group_id=12867 |