Search code examples
mysqljythonmonkeyrunner

MonkeyRunner and MySQL


I got a problem using MySQL with MonkeyRunner, need a help with MySQL Driver Name. The starting of my script is:

#coding : utf-8

from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice
from com.ziclix.python.sql import zxJDBC

db = zxJDBC.connect('jdbc:mysql://localhost/android','dani','123456','com.mysql.jdbc.Driver')
.
.
etc

Each time I got an error that com.mysql.jdbc.Driver not found even when using org.git.mm.mysql.Driver. I set classpath as following :

export CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java.5.1.10.jar

Any tips or hits?

Regards,,,


Solution

  • You need to include the relevant jar in the correct location. There should be a libs folder where you need to put the jar. It should be in the top level of your project folder, at the same level as the src and res folders.