From: Leo S. M. <leo...@gm...> - 2008-11-17 13:42:44
|
On Sat, Nov 15, 2008 at 10:20 PM, Aljosa Mohorovic <alj...@gm...> wrote: > i've succesfully installed jython 2.5 beta and django-jython, then > created a django project using postgres as database. > now i'm interested to access database via jndi defined in app server > and test this war installation in websphere and jboss. > anybody has experience with this? i'm looking for some docs/links/tips > or anything that could help me. > thanks I haven't done that yet, but it should be fairly straightforward. I encourage you to modify the source of doj.backends.zxjdbc.postgresql.base[1], where the JDBC connection URL is currently being generated (on the _cursor() method). My first idea would be to check if some settings variable (JNDI_DATASOURCE for example) is set, and use it to obtain the connection, but feel free to use the approach you judge better. Patches are very appreciated, specially here where a very useful use case such as connection pooling can be implemented with some (hopefully) easy steps. [1] http://code.google.com/p/django-jython/source/browse/trunk/doj/backends/zxjdbc/postgresql/base.py -- Leo Soto M. http://blog.leosoto.com |