December 2010
Intermediate to advanced
451 pages
11h 16m
English
You are working with a Jython program and want to call some PL/SQL stored procedures or functions from it.
Use Jython's zxJDBC API to obtain a connection to the Oracle Database, and then call the PL/SQL stored procedure passing parameters as required. The following code is an example of a Jython script that performs these tasks:
from __future__ import with_statement
from com.ziclix.python.sql import zxJDBC
# Set up connection variables
jdbc_url = "jdbc:oracle:thin:@host:1521:dbname"
username = "user"
password = "password"
driver = "oracle.jdbc.driver.OracleDriver"
# obtain a connection using the with-statment
with zxJDBC.connect(jdbc_url, username, password, driver) as conn: with ...Read now
Unlock full access