我爱编程

jpype._jexception.RuntimeExcepti

2018-04-09  本文已影响491人  什锦甜
conn_mysql = jaydebeapi.connect("com.mysql.jdbc.Driver",
                       "jdbc:mysql://[hostname]:[port]/[database]",
                       ["username", "password"],
                       "/Users/yt/Downloads/mysql-connector-java-5.1.46/mysql-connector-java-5.1.46.jar",)
conn_postgre = jaydebeapi.connect("org.postgresql.Driver",
                       "jdbc:postgresql://[hostname]:[port]/[database]",
                       ["username", "password"],
                       "/Users/yt/Downloads/postgresql-42.2.2.jar",)

I specify path for all JDBC drivers my program requires in both calls to jdbc.connect(). I change the code like following and it works:

conn_mysql = jaydebeapi.connect("com.mysql.jdbc.Driver",
                       "jdbc:mysql://[hostname]:[port]/[database]",
                       ["username", "password"],
                       ["/Users/yt/Downloads/mysql-connector-java-5.1.46/mysql-connector-java-5.1.46.jar","/Users/yt/Downloads/postgresql-42.2.2.jar"],)

conn_postgre = jaydebeapi.connect("org.postgresql.Driver",
                       "jdbc:postgresql://[hostname]:[port]/[database]",
                       ["username", "password"],
                       ["/Users/yt/Downloads/mysql-connector-java-5.1.46/mysql-connector-java-5.1.46.jar","/Users/yt/Downloads/postgresql-42.2.2.jar"],)
上一篇下一篇

猜你喜欢

热点阅读