【发布时间】:2018-07-25 09:16:32
【问题描述】:
作为python的新手,尝试编写python代码以连接到oracle数据库而不使用任何即时客户端。我正在使用 jaydebeapi 和 jpype,正如本论坛的其他一些主题中所建议的那样。经过很多障碍,我现在陷入了这个错误。这是代码。
import jaydebeapi
import jpype
try:
con = jaydebeapi.connect('oracle.jdbc.driver.OracleDriver', ['windb19.ams.com', 'AA3112D1OS', 'advantage', 'C:\Tools\ojdbc8.jar'])
cur = con.cursor()
cur.execute('select * from r_sc_user_info')
except Exception as e:
print e
我收到的错误如下
C:\Python27\python.exe C:/Project/Robot_Framework/SampleProject/CustomLibraries/DBLibrary.py
java.lang.Exception: Class oracle.jdbc.driver.OracleDriver not found
Process finished with exit code 0
【问题讨论】:
-
Oracle JDBC 驱动程序 JAR 不能在您的 JVM CLASSPATH 中。