Re: a hobbyist's dilemma
Since you want to learn to use python with a database you may want to try it with SQLite. SQLite is a very easy to use database that stores the whole database in one file. Working with it would be very similar to working with Mysql through python. http://www.sqlite.org http://initd.org/tracker/pysqlite -- http://mail.python.org/mailman/listinfo/python-list
Jpype on RHEL v3
I have been trying out jpype for python to java work and love it. It
works great on my gentoo box with the java 1.4.2 blackdown sdk.
I am now trying it on Red Hat Enterprise Linux 3 for access to business
intelligence tools (JasperReports, Mondrian, Pentaho, etc) for which we
don't have analogous tools in cpython yet. My idea it to use jpype in
a cherrypy application server to tie these java BI tools into a website
interface without having to delve into the more complex java J2EE
application servers and lose all the python libraries that I know and
love.
Here is my problem.
When trying to start the jvm with the sun jre I get this error.
[EMAIL PROTECTED] root]# python2.4
Python 2.4.2 (#1, Dec 1 2005, 05:44:04)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-53)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import jpype
>>> jpype.startJVM('/usr/lib/jvm/java-1.4.2-sun/jre/lib/i386/client/libjvm.so')
Error occurred during initialization of VM
Unable to load native library: libjvm.so: cannot open shared object
file: No such file or directory
and then python dies.
When I try to start the jvm with the ibm jre I get this error.
[EMAIL PROTECTED] root]# python2.4
Python 2.4.2 (#1, Dec 1 2005, 05:44:04)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-53)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import jpype
>>> jpype.startJVM('/usr/lib/jvm/java-1.4.2-ibm-1.4.2.2/jre/bin/classic/libjvm.so')
Unable to find UTE, path used libjava.so/libute.so
JVMCI170: Please check the path to shared libraries
Traceback (most recent call last):
File "", line 1, in ?
File "/usr/lib/python2.4/site-packages/jpype/_core.py", line 25, in
startJVM
_jpype.startup(jvm, tuple(args), True)
RuntimeError: Unable to start JVM at src/native/common/jp_env.cpp:54
but the python interpreter is still running.
Can anyone point me in the right direction so I can fix this?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Re: Jpype on RHEL v3
I found the problem. So if anyone else has it here is the fix. In the documentation distributed with JPype 0.5.1 in the examples/linux directory, there is a file that describes a problem with loading the jvm on linux. So one needs to modify the LD_LIBRARY_PATH environment variable to fix it. I did that after changing one line in /usr/lib/python2.4/site-packages/jpype/_linux.py line 37 to return "/etc/alternatives/java_sdk/jre/lib/i386/client/libjvm.so" so that jpype.getDefaultJVMPath() would return the correct libjvm.so path for my install. Then I did export LD_LIBRARY_PATH=/etc/alternatives/java_sdk/jre/lib/i386:/etc/alternatives/java_sdk/jre/lib/i386/client after doing that the sun 1.4.2 jre loaded just fine with: [EMAIL PROTECTED] root]# python2.4 Python 2.4.2 (#1, Dec 1 2005, 05:44:04) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-53)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import jpype >>> jpype.startJVM(jpype.getDefaultJVMPath()) >>> -- http://mail.python.org/mailman/listinfo/python-list
jpype and zxJDBC
I would love to be able to use jdbc drivers using the python db 2.0 api and cpython. Has anyone used jpype and zxJDBC (distributed with jython) together? I am trying and what I have tried does not yet work. If I figure anything out that works I will post it here. Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: jpype and zxJDBC
No luck yet with the python db api. I keep getting this error when trying to create a com.ziclix.python.sql.PyConnection object: File "/usr/lib/python2.4/site-packages/jpype/_jpackage.py", line 53, in __call__ raise TypeError, "Package "+self.__name+" is not Callable" TypeError: Package com.ziclix.python.sql.PyConnection is not Callable But if I use jython on the same machine and create the PyConnection object (I checked and the jython jar file is loaded fine both times) it works. So, I decided to try to see if I could use jdbc from cpython using jpype and that works great. It's quite a bit faster then using jython and the db api on the same database my tests too. -- http://mail.python.org/mailman/listinfo/python-list
Re: jpype and zxJDBC
I haven't compared them, and you may be exacly right. Paul -- http://mail.python.org/mailman/listinfo/python-list
