com.ziclix.python.sql
Class zxJDBC

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

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

Creates database connections.

 from com.ziclix.python.sql import zxJDBC
 db = zxJDBC.connect("jdbc:mysql://localhost:3306/MySql", None, None, "org.gjt.mm.mysql.Driver")
 

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

Field Summary
static org.python.core.PyClass __class__
           
static org.python.core.PyObject DatabaseError
           
static org.python.core.PyObject DataError
           
static org.python.core.PyObject Error
           
static org.python.core.PyObject InterfaceError
           
static org.python.core.PyObject NotSupportedError
           
static org.python.core.PyObject OperationalError
           
static org.python.core.PyObject ProgrammingError
           
static org.python.core.PyObject Warning
           
 
Constructor Summary
zxJDBC()
           
 
Method Summary
protected static void addSqlTypes(org.python.core.PyObject dict)
           
static PyConnection connect(java.lang.String url, java.util.Properties props, java.lang.String driver)
          Connects to the database.
static org.python.core.PyException DatabaseError(java.lang.String msg)
           
static org.python.core.PyException DataError(java.lang.String msg)
           
static org.python.core.PyObject Date(int year, int month, int day)
          This function constructs an object holding a date value.
static org.python.core.PyObject DateFromTicks(double ticks)
          This function constructs an object holding a date value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).
protected static org.python.core.PyException Error(java.sql.SQLException e)
           
static org.python.core.PyException Error(java.lang.String msg)
           
protected  org.python.core.PyClass getPyClass()
           
 void initModule(org.python.core.PyObject dict)
          Initializes the module.
static org.python.core.PyException InterfaceError(java.lang.String msg)
           
static org.python.core.PyException NotSupportedError(java.lang.String msg)
           
static org.python.core.PyException OperationalError(java.lang.String msg)
           
static org.python.core.PyException ProgrammingError(java.lang.String msg)
           
static org.python.core.PyObject Time(int hour, int minute, int second)
          This function constructs an object holding a time value.
static org.python.core.PyObject TimeFromTicks(double ticks)
          This function constructs an object holding a time value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).
static org.python.core.PyObject Timestamp(int year, int month, int day, int hour, int minute, int second)
          This function constructs an object holding a time stamp value.
static org.python.core.PyObject TimestampFromTicks(double ticks)
          This function constructs an object holding a time stamp value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).
static org.python.core.PyException Warning(java.lang.String msg)
           
 
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__, __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__, __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, toString, wait, wait, wait
 

Field Detail

__class__

public static org.python.core.PyClass __class__

Error

public static org.python.core.PyObject Error

DatabaseError

public static org.python.core.PyObject DatabaseError

NotSupportedError

public static org.python.core.PyObject NotSupportedError

ProgrammingError

public static org.python.core.PyObject ProgrammingError

OperationalError

public static org.python.core.PyObject OperationalError

DataError

public static org.python.core.PyObject DataError

InterfaceError

public static org.python.core.PyObject InterfaceError

Warning

public static org.python.core.PyObject Warning
Constructor Detail

zxJDBC

public zxJDBC()
Method Detail

initModule

public void initModule(org.python.core.PyObject dict)
Initializes the module.
Specified by:
initModule in interface org.python.core.InitModule
Parameters:
dict -  

getPyClass

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

addSqlTypes

protected static void addSqlTypes(org.python.core.PyObject dict)
                           throws org.python.core.PyException

Error

public static org.python.core.PyException Error(java.lang.String msg)

Error

protected static org.python.core.PyException Error(java.sql.SQLException e)

DatabaseError

public static org.python.core.PyException DatabaseError(java.lang.String msg)

NotSupportedError

public static org.python.core.PyException NotSupportedError(java.lang.String msg)

ProgrammingError

public static org.python.core.PyException ProgrammingError(java.lang.String msg)

OperationalError

public static org.python.core.PyException OperationalError(java.lang.String msg)

DataError

public static org.python.core.PyException DataError(java.lang.String msg)

InterfaceError

public static org.python.core.PyException InterfaceError(java.lang.String msg)

Warning

public static org.python.core.PyException Warning(java.lang.String msg)

connect

public static PyConnection connect(java.lang.String url,
                                   java.util.Properties props,
                                   java.lang.String driver)
Connects to the database.
Parameters:
url - connection url
props - Properties to be passed to driver
driver - valid JDBC driver
Returns:
connection to the database

Date

public static org.python.core.PyObject Date(int year,
                                            int month,
                                            int day)
This function constructs an object holding a date value.

Time

public static org.python.core.PyObject Time(int hour,
                                            int minute,
                                            int second)
This function constructs an object holding a time value.

Timestamp

public static org.python.core.PyObject Timestamp(int year,
                                                 int month,
                                                 int day,
                                                 int hour,
                                                 int minute,
                                                 int second)
This function constructs an object holding a time stamp value.

DateFromTicks

public static org.python.core.PyObject DateFromTicks(double ticks)
This function constructs an object holding a date value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details). Note: The DB API 2.0 spec calls for time in seconds since the epoch while the Java Date object returns time in milliseconds since the epoch. This module adheres to the python API and will therefore use time in seconds rather than milliseconds, so adjust any Java code accordingly.
Parameters:
ticks - number of seconds since the epoch

TimeFromTicks

public static org.python.core.PyObject TimeFromTicks(double ticks)
This function constructs an object holding a time value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details). Note: The DB API 2.0 spec calls for time in seconds since the epoch while the Java Date object returns time in milliseconds since the epoch. This module adheres to the python API and will therefore use time in seconds rather than milliseconds, so adjust any Java code accordingly.
Parameters:
ticks - number of seconds since the epoch

TimestampFromTicks

public static org.python.core.PyObject TimestampFromTicks(double ticks)
This function constructs an object holding a time stamp value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details). Note: The DB API 2.0 spec calls for time in seconds since the epoch while the Java Date object returns time in milliseconds since the epoch. This module adheres to the python API and will therefore use time in seconds rather than milliseconds, so adjust any Java code accordingly.
Parameters:
ticks - number of seconds since the epoch


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