NAME
Oak::IO::DBI - IO routines to exchange data with databases using DBI
DESCRIPTION
This module provides access for exchange data with databases using DBI.
PROPERTIES
- datasource (virtual)
-
DBI datasorce string, used to create the connection, defined using the parameters passed to new.
- hostname,database,dbdriver,username,password,options
-
DBI options. See DBI documentation for more help.
METHODS
- connect
-
Register the connection for this object. Generates an onConnect event.
Could raise the Oak::IO::DBI::Error::ConnectionFailure exception.
- do_sql(SQL)
-
Prepare, executes and test if successfull. Returns the Sth. Generates an onSql event (passes $sql and $sth to the function called).
Could rause the following exceptions: Oak::Filer::DBI::Error::SQLSyntaxError and Oak::Filer::DBI::Error::SQLExecuteError
- quote
-
Quotes a string, using DBI->quote unless empty, else uses "''".
- get_dbh
-
Returns the DBI object.
- disconnect
-
Called by DESTROY, releases the DBI connection. It disconnects. Generates a onDisconnect event.
- DESTROY
-
Disconnects and generates a onDestroy event.
EXCEPTION HANDLING
- Oak::IO::DBI::Error::SQLExecuteError;
-
This class is raised when the sql has an error while executing
EXAMPLES
require Oak::IO::DBI;
my $io = new Oak::IO::DBI
(
name => "IODBI", # mandatory (see Oak::Component)
dbdriver => "mysql", # mandatory, any supported by DBI
database => "mydatabase", # mandatory
hostname => "hostname", # mandatory
username => "dbusername", # optional
password => "userpasswd", # optional
options => { DBI OPTIONS }, # optional. A hash reference to DBI options
)
P.S.: In the case of the automatic creation by an owner object all the
properties will be passed through the RESTORE hash and the OWNER variable.
See Oak::Component.
COPYRIGHT
Copyright (c) 2001 Daniel Ruoso <daniel@ruoso.com> and Rodolfo Sikora <rodolfo@trevas.net>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 30:
You forgot a '=back' before '=head1'