com.ziclix.python.sql
Class PyConnection

java.lang.Object
  |
  +--org.python.core.PyObject
        |
        +--com.ziclix.python.sql.PyConnection
All Implemented Interfaces:
org.python.core.InitModule, java.io.Serializable

public class PyConnection
extends org.python.core.PyObject
implements org.python.core.InitModule

A connection to the database.

Version:
$Revision: 1.4 $
Author:
brian zimmer, last revised by $Author: bzimmer $
See Also:
Serialized Form

Field Summary
static org.python.core.PyClass __class__
           
 
Constructor Summary
PyConnection()
          Don't really want this to be public but InitModule requires it.
 
Method Summary
 org.python.core.PyObject __findattr__(java.lang.String name)
          $METHOD_DESCRIPTION$
 void __setattr__(java.lang.String name, org.python.core.PyObject value)
          $METHOD_DESCRIPTION$
 void close()
          Close the connection now (rather than whenever __del__ is called).
 void commit()
          Commit any pending transaction to the database.
 PyCursor cursor()
          Return a new Cursor Object using the connection.
protected  org.python.core.PyClass getPyClass()
          $METHOD_DESCRIPTION$
 void initModule(org.python.core.PyObject dict)
          $METHOD_DESCRIPTION$
 void rollback()
          This method is optional since not all databases provide transaction support. In case a database does provide transactions this method causes the database to roll back to the start of any pending transaction.
 java.lang.String toString()
          Produces a string representation of the object.
 
Methods inherited from class org.python.core.PyObject
__abs__, __add__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __cmp__, __coerce__, __coerce_ex__, __complex__, __contains__, __delattr__, __delattr__, __delitem__, __delitem__, __delslice__, __delslice__, __dir__, __div__, __divmod__, __findattr__, __finditem__, __finditem__, __finditem__, __float__, __getattr__, __getattr__, __getitem__, __getitem__, __getslice__, __getslice__, __hash__, __hex__, __int__, __invert__, __len__, __long__, __lshift__, __mod__, __mul__, __neg__, __nonzero__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rdiv__, __rdivmod__, __repr__, __rlshift__, __rmod__, __rmul__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rxor__, __setattr__, __setitem__, __setitem__, __setitem__, __setslice__, __setslice__, __str__, __sub__, __tojava__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _dodel, _doget, _doget, _doset, _eq, _ge, _gt, _in, _is, _isnot, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _xor, addKeys, equals, hashCode, invoke, invoke, invoke, invoke, invoke, isCallable, isMappingType, isNumberType, isSequenceType, safeRepr
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

__class__

public static org.python.core.PyClass __class__
Constructor Detail

PyConnection

public PyConnection()
Don't really want this to be public but InitModule requires it.
Method Detail

toString

public java.lang.String toString()
Produces a string representation of the object.
Overrides:
toString in class java.lang.Object
Returns:
string representation of the object.

initModule

public void initModule(org.python.core.PyObject dict)
$METHOD_DESCRIPTION$
Specified by:
initModule in interface org.python.core.InitModule
Parameters:
dict -  

__setattr__

public void __setattr__(java.lang.String name,
                        org.python.core.PyObject value)
$METHOD_DESCRIPTION$
Overrides:
__setattr__ in class org.python.core.PyObject
Parameters:
name -  
value -  

__findattr__

public org.python.core.PyObject __findattr__(java.lang.String name)
$METHOD_DESCRIPTION$
Overrides:
__findattr__ in class org.python.core.PyObject
Parameters:
name -  
Returns:
 

getPyClass

protected org.python.core.PyClass getPyClass()
$METHOD_DESCRIPTION$
Overrides:
getPyClass in class org.python.core.PyObject
Returns:
 

close

public void close()
Close the connection now (rather than whenever __del__ is called). The connection will be unusable from this point forward; an Error (or subclass) exception will be raised if any operation is attempted with the connection. The same applies to all cursor objects trying to use the connection.

commit

public void commit()
Commit any pending transaction to the database. Note that if the database supports an auto-commit feature, this must be initially off. An interface method may be provided to turn it back on. Database modules that do not support transactions should implement this method with void functionality.

rollback

public void rollback()
This method is optional since not all databases provide transaction support. In case a database does provide transactions this method causes the database to roll back to the start of any pending transaction. Closing a connection without committing the changes first will cause an implicit rollback to be performed.

cursor

public PyCursor cursor()
Return a new Cursor Object using the connection. If the database does not provide a direct cursor concept, the module will have to emulate cursors using other means to the extent needed by this specification.
Returns:
a new cursor using this connection


Copyright (c) 2000 brian zimmer. All Rights Reserved.