|
From: <Wil...@FI...> - 2000-12-12 13:46:22
|
hi there,
We're looking to create a wrapper around Oracle's sqlplus using jpython
(jython). The idea being that users give sql statements which are
pre-processed by our system and then sent (changed or unchanged as required)
to sqlplus to be actioned on the database. We got it working by writing to
a file and calling os.system('sqlplus user/pass @file'), but we're wondering
now if it wouldn't be possible to create a more-permanent instance of
sqlplus running as a sub-process and pass it lines of sql to action straight
away...
something along the lines of..
>>> from jnios import os
>>> sqlproc = os.popen('sqlplus user/pass','w')
>>> sqlproc.write(sqlstatement)
>>> sqlproc.flush()
I'm having a few problems with this.
It seems very difficult to send it a string that it likes. I'm getting all
sorts of "SIGBUS 10 bus error". Hopefully the dump below makes sense to
somebody
>>> sqlproc.write('select * from cat;\n')
SIGBUS 10 bus error
si_signo [10]: BUS
si_errno [0]:
si_code [1]: BUS_ADRALN [addr: 0x4cf62e]
stackpointer=FFBEC538
Exiting Thread (sys_thread_t:0xff30c2e8) : no stack
Exiting Thread (sys_thread_t:0x2e6e10) : no stack
Exiting Thread (sys_thread_t:0x2e6bf8) : no stack
Exiting Thread (sys_thread_t:0x2e69e0) : no stack
"Finalizer" (TID:0x155a10, sys_thread_t:0x155948, state:CW, thread_t: t@6,
threadID:0xfec81dc8, stack_bottom:0xfec82000, stack_size:0x20000) prio=8
We are using Solaris by the way. If anyone out there can help (even if its
just to say "it works for me"), it would be much appreciated...
- will w
eSafe Protect Gateway (tm) has scanned this mail for viruses, vandals and
suspicious attachments and has found it to be CLEAN.
|