Message1626

Author r_walter
Recipients
Date 2007-06-07.20:19:37
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Hello,

I used jython 2.2b2 for accessing a postgresql database with the actual driver build 505. I tried the same with a firebird database. In both cases i got the error:

java.lang.ClassCastException: java.lang.ClassCastException: org.python.core.PyNone cannot be cast to com.ziclix.python.sql.PyConnection

when getting a cursor from the database connection. The example program used is below. The same program worked when using jython 2.1.

# test access on database
from com.ziclix.python.sql import zxJDBC

database="jdbc:postgresql://dios/standarddb"
user="amarok"
password="xxxx"
driver="org.postgresql.Driver"

db = zxJDBC.connect(database, user, password, driver)

curs = db.cursor()

curs.execute("select count(*) from album")

curs.description

for a in curs.fetchall():
    print a

curs.close()
db.close()


The full error is (line 11 is 'curs=db.cursor()'):

Traceback (innermost last):
  File "database_access.py", line 11, in ?
java.lang.ClassCastException: org.python.core.PyNone cannot be cast to com.ziclix.python.sql.PyConnection
        at com.ziclix.python.sql.ConnectionFunc.__call__(Unknown Source)
        at org.python.core.PyObject.invoke(Unknown Source)
        at org.python.pycode._pyx0.f$0(database_access.py:11)
        at org.python.pycode._pyx0.call_function(database_access.py)
        at org.python.core.PyTableCode.call(Unknown Source)
        at org.python.core.PyCode.call(Unknown Source)
        at org.python.core.Py.runCode(Unknown Source)
        at org.python.core.__builtin__.execfile_flags(Unknown Source)
        at org.python.util.PythonInterpreter.execfile(Unknown Source)
        at org.python.util.jython.main(Unknown Source)

java.lang.ClassCastException: java.lang.ClassCastException: org.python.core.PyNone cannot be cast to com.ziclix.python.sql.PyConnection

History
Date User Action Args
2008-02-20 17:17:50adminlinkissue1733044 messages
2008-02-20 17:17:50admincreate