Package com.ziclix.python.sql
Class Procedure
java.lang.Object
com.ziclix.python.sql.Procedure
This class provides the necessary functionality to call stored
procedures. It handles managing the database metadata and binding
the appropriate parameters.
- Author:
- brian zimmer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isInput
(int index) This method determines whether the param at the specified index is an IN or INOUT param for a stored procedure.void
normalizeInput
(PyObject params, PyObject bindings) Prepare the binding dictionary with the correct datatypes.Prepares the statement and registers the OUT/INOUT parameters (if any).prepareCall
(PyObject rsType, PyObject rsConcur) Prepares the statement and registers the OUT/INOUT parameters (if any).toSql()
Returns the call in the syntax:
-
Constructor Details
-
Procedure
Constructor Procedure- Parameters:
cursor
- cursor an open cursorname
- name a string or tuple representing the name- Throws:
SQLException
-
-
Method Details
-
prepareCall
Prepares the statement and registers the OUT/INOUT parameters (if any).- Returns:
- CallableStatement
- Throws:
SQLException
-
prepareCall
Prepares the statement and registers the OUT/INOUT parameters (if any).- Parameters:
rsType
- the value of to be created ResultSet typersConcur
- the value of the to be created ResultSet concurrency- Returns:
- CallableStatement
- Throws:
SQLException
-
normalizeInput
Prepare the binding dictionary with the correct datatypes.- Parameters:
params
- a non-None list of paramsbindings
- a dictionary of bindings- Throws:
SQLException
-
isInput
This method determines whether the param at the specified index is an IN or INOUT param for a stored procedure. This is only configured properly AFTER a call to normalizeInput().- Parameters:
index
- JDBC indexed column index (1, 2, ...)- Returns:
- true if the column is an input, false otherwise
- Throws:
SQLException
-
toSql
Returns the call in the syntax:{? = call <procedure-name>(?, ?, ...)} {call <procedure-name>(?, ?, ...)}
As of now, all parameters variables are created and no support for named variable calling is supported.- Returns:
- String
- Throws:
SQLException
-