Peach :: Publishers :: sql :: Odbc :: Class Odbc
[hide private]

Class Odbc

source code


Publisher for ODBC connections. Generated data sent as a SQL query via execute. Calling receave will return a string of all row data concatenated together with as field separator.

Currently this Publisher makes use of the odbc package which is some what broken in that you must create an actual ODBC DSN via the ODBC manager. Check out mxODBC which is not open source for another alterative.

Note: Each call to start/stop will create and close the SQL connection and cursor.

Instance Methods [hide private]
 
__init__(self, dsn) source code
 
start(self)
Create connection to server.
source code
 
stop(self)
Close any open cursors, and close connection to server.
source code
string
call(self, method, args)
Create cursor and execute data.
source code

Inherited from publisher.Publisher: accept, close, property, receive, send

Method Details [hide private]

__init__(self, dsn)
(Constructor)

source code 
Parameters:
  • dsn (string) - DSN must be in format of "dsn/user/password" where DSN is a DSN name.

start(self)

source code 

Create connection to server.

Overrides: publisher.Publisher.start

stop(self)

source code 

Close any open cursors, and close connection to server.

Overrides: publisher.Publisher.stop

call(self, method, args)

source code 

Create cursor and execute data.

Parameters:
  • method - Method to call
  • args - Array of strings as arguments
Returns: string
data returned (if any)
Overrides: publisher.Publisher.call