-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDBC unwrapping doesn't work #21
Comments
Hi, Ok, i didn't tried the example, but a fast research on the internet show that The difference here is that we guess the type from the signature. Try: connection = DriverManager.getConnection(url)
connection = cast('org.olap4j.OlapConnection', connection)
result = connection.prepareOlapStatement(mdx).executeQuery() This might work, not tested. Try and report here :) |
I think that the problem is that Jnius handles objects returned from Java as JavaObject instead of registering their class an returning a proper JavaClass descendant instance. I'm sorry I have so much to say, and so little time to contribute right now. |
Can you do a "print connection" and give the result ? |
Try to: connection = DriverManager.getConnection(url)
print 'before', connection
connection = cast(OlapConnection, connection)
print 'after', connection |
OK, the Jython worked by a fluke; the equivalent Java wasn't correct. |
Problem
I'm using Olap4j, and, as documented on page 11 of this PDF, Java is supposed to automatically unwrap JDBC connection objects to gain access to their true connection, which works under Jython but not PyJNIus. (This seems like magic to me, so I don't understand the details.)
Steps to reproduce
test.py
file given at the bottom of this report in the Mondrian directory. Run it. Under Jython 2.7, it runs fine, but under PyJNIus, it reports:test.py:
The text was updated successfully, but these errors were encountered: