MYSQL connection to jython

  • Neha Dharni

    Neha Dharni - 2010-07-29

    While I am trying to connect with database through jython, I am getting
    exception "unable to instantiate datasource" in line mysqlConn =
    zxJDBC.connectx(url, user, password, driver,CHARSET='iso_1')

    My piece of code is :

    from com.ziclix.python.sql import zxJDBC

    url = 'jdbc:mysql://localhost/test'

    user = 'test'

    password = 'pass123'

    driver = ''


    mysqlConn = zxJDBC.connectx(url, user, password, driver,CHARSET='iso_1')

    if mysqlConn is not None:

    print "Successfully connected"


    print "Not able to connect with database"

    except zxJDBC.DatabaseError,err:

    print err

    I have installed mysql-connector-java-5.1.13-bin.jar too and included that in
    my classpath.Any clue why I am getting this error?

  • Kyle VanderBeek

    Kyle VanderBeek - 2010-07-29

    Although you're using it from Python/Jython, you're not actually using the
    MySQLdb driver that exists in this project. You actually want the JDBC driver


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks