Article 5Q5Q7 traccar - H2 database - python connection

traccar - H2 database - python connection

by
kzo81
from LinuxQuestions.org on (#5Q5Q7)
Hi,

I'm running Traccar in docker and I'd like to connect to its H2 database within the container.

this is my initial code:

Code:
import jaydebeapi

conn = jaydebeapi.connect("org.h2.Driver",
"jdbc:h2:/home/user/Documents/traccar/target/database",
["sa", ""],'/usr/local/openjdk-11')
curs = conn.cursor()
conn.close()this is the error message:

Code: File "dbmanager.py", line 5, in <module>
["sa", ""])
File "/usr/local/lib/python3.7/dist-packages/jaydebeapi/__init__.py", line 412, in connect
jconn = _jdbc_connect(jclassname, url, driver_args, jars, libs)
File "/usr/local/lib/python3.7/dist-packages/jaydebeapi/__init__.py", line 221, in _jdbc_connect_jpype
jpype.JClass(jclassname)
File "/usr/local/lib/python3.7/dist-packages/jpype/_jclass.py", line 99, in __new__
return _jpype._getClass(jc)
TypeError: Class org.h2.Driver is not foundI also tried to initialise it with "com.mysql.cj.jdbc.Driver" however I couldnt establish connection.

Could you please help me?latest?d=yIl2AUoC8zA latest?i=4NanOXUYnXw:C_lz8ET4pX0:F7zBnMy latest?i=4NanOXUYnXw:C_lz8ET4pX0:V_sGLiP latest?d=qj6IDK7rITs latest?i=4NanOXUYnXw:C_lz8ET4pX0:gIN9vFw4NanOXUYnXw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments