Class PyStatement

java.lang.Object
org.python.core.PyObject
com.ziclix.python.sql.PyStatement
All Implemented Interfaces:
Serializable, Traverseproc

public class PyStatement extends PyObject implements Traverseproc
Class PyStatement
Author:
brian zimmer
See Also:
  • Field Details

    • STATEMENT_STATIC

      public static final int STATEMENT_STATIC
      Denotes a simple Statement with no parameters.
      See Also:
    • STATEMENT_PREPARED

      public static final int STATEMENT_PREPARED
      Denotes a PreparedStatement either explicitly created by the user, or from a cursor (due to the presence of bind parameters).
      See Also:
    • STATEMENT_CALLABLE

      public static final int STATEMENT_CALLABLE
      Denotes a stored procedure call.
      See Also:
  • Constructor Details

    • PyStatement

      public PyStatement(Statement statement, Object sql, int style)
      Constructor PyStatement
      Parameters:
      statement -
      sql -
      style -
    • PyStatement

      public PyStatement(Statement statement, Procedure procedure)
      Constructor PyStatement
      Parameters:
      statement -
      procedure -
  • Method Details

    • __unicode__

      public PyUnicode __unicode__()
      Overrides:
      __unicode__ in class PyObject
    • __str__

      public PyString __str__()
      Description copied from class: PyObject
      Equivalent to the standard Python __str__ method. The default implementation (in PyObject) calls PyObject.__repr__(), making it unnecessary to override __str__ in sub-classes of PyObject where both forms are the same. A common choice is to provide the same implementation to __str__ and toString, for consistency in the printed form of objects between Python and Java.
      Overrides:
      __str__ in class PyObject
    • toString

      public String toString()
      Overrides:
      toString in class PyObject
    • __findattr_ex__

      public PyObject __findattr_ex__(String name)
      Gets the value of the attribute name.
      Overrides:
      __findattr_ex__ in class PyObject
      Parameters:
      name -
      Returns:
      the attribute for the given name
    • classDictInit

      public static void classDictInit(PyObject dict)
      Initializes the object's namespace.
      Parameters:
      dict -
    • __del__

      public void __del__()
      Delete the statement.
    • execute

      public void execute(PyCursor cursor, PyObject params, PyObject bindings) throws SQLException
      Method execute
      Parameters:
      cursor -
      params -
      bindings -
      Throws:
      SQLException
    • close

      public void close()
      Method close
    • traverse

      public int traverse(Visitproc visit, Object arg)
      Description copied from interface: Traverseproc
      Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc.visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc.visit(PyObject, Object) must not be called with a null PyObject-argument.
      Specified by:
      traverse in interface Traverseproc
    • refersDirectlyTo

      public boolean refersDirectlyTo(PyObject ob)
      Description copied from interface: Traverseproc
      Optional operation. Should only be implemented if it is more efficient than calling Traverseproc.traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.
      Specified by:
      refersDirectlyTo in interface Traverseproc