Hello,
I developed some useful Jython script in Eclipse, using ojdbc6.jar as driver library (attached to the project as "external library"). When debugging in Eclipse, everything goes fine. Also standalone run on the development PC runs OK.
Then I copied the complete Jython 2.5.2 installation to another machine (with Java JRE 1.6.30), copied my script and the ojdbc6.jar library in the same directory as the script.
I call it with
<pathtojava>\ja va.exe -cp ojdbc6.jar -jar ..\jython2.5.2\ jython.jar myscript.py (which works on the original PC)
Now, it throws exception in this code:
from oracle.jdbc import OracleDriver
...
class SqlTester:
...
def connect( self ):
self.driver = OracleDriver()
self.connection = DriverManager.g etConnection( "jdbc:oracle:th in:@%s:%s:%s" % ( self.host, self.port, self.sid ), self.user, self.psw )
...
The exception is:
Traceback (most recent call last):
File "myscript.p y", line 119, in <module>
tester.run_all_ tests()
File "myscript.p y", line 79, in run_all_tests
self.connect()
File "myscript.p y", line 60, in connect
self.connection = DriverManager.g etConnection( "jdbc:oracle:th in:@%s:%s:%s" % ( self.host, self.port, self.sid )
at java.sql.Driver Manager.getConn ection(Unknown Source)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at sun.reflect.Nat iveMethodAccess orImpl.invoke0( Native Method)
at sun.reflect.Nat iveMethodAccess orImpl.invoke(U nknown Source)
at sun.reflect.Del egatingMethodAc cessorImpl.invo ke(Unknown Source)
at java.lang.refle ct.Method.invok e(Unknown Source)
java.sql.SQLExc eption: java.sql.SQLExc eption: No suitable driver found for jdbc:oracle:thi n:@xxxxxx:1521: DWH
What am I doing wrong?
I developed some useful Jython script in Eclipse, using ojdbc6.jar as driver library (attached to the project as "external library"). When debugging in Eclipse, everything goes fine. Also standalone run on the development PC runs OK.
Then I copied the complete Jython 2.5.2 installation to another machine (with Java JRE 1.6.30), copied my script and the ojdbc6.jar library in the same directory as the script.
I call it with
<pathtojava>\ja va.exe -cp ojdbc6.jar -jar ..\jython2.5.2\ jython.jar myscript.py (which works on the original PC)
Now, it throws exception in this code:
from oracle.jdbc import OracleDriver
...
class SqlTester:
...
def connect( self ):
self.driver = OracleDriver()
self.connection = DriverManager.g etConnection( "jdbc:oracle:th in:@%s:%s:%s" % ( self.host, self.port, self.sid ), self.user, self.psw )
...
The exception is:
Traceback (most recent call last):
File "myscript.p y", line 119, in <module>
tester.run_all_ tests()
File "myscript.p y", line 79, in run_all_tests
self.connect()
File "myscript.p y", line 60, in connect
self.connection = DriverManager.g etConnection( "jdbc:oracle:th in:@%s:%s:%s" % ( self.host, self.port, self.sid )
at java.sql.Driver Manager.getConn ection(Unknown Source)
at java.sql.Driver Manager.getConn ection(Unknown Source)
at sun.reflect.Nat iveMethodAccess orImpl.invoke0( Native Method)
at sun.reflect.Nat iveMethodAccess orImpl.invoke(U nknown Source)
at sun.reflect.Del egatingMethodAc cessorImpl.invo ke(Unknown Source)
at java.lang.refle ct.Method.invok e(Unknown Source)
java.sql.SQLExc eption: java.sql.SQLExc eption: No suitable driver found for jdbc:oracle:thi n:@xxxxxx:1521: DWH
What am I doing wrong?
Comment