NAME

Oak::IO::DBI - IO routines to exchange data with databases using DBI

SYNOPSIS

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.

DESCRIPTION

This module provides access for exchange data with databases using DBI.

OBJECT PROPERTIES

datasource (readonly)

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.

OBJECT METHODS

constructor(PARAMS)

Called by new. You do not want do call it by yourself. Generates a onCreate event.

Could raise the Oak::Error::ParamsMissing exception.

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::ConnectionFailure;

This class is used in the register_connection when it fails

Oak::IO::DBI::Error::SQLSyntaxError;

This class is raised when the sql has wrong syntax

Oak::IO::DBI::Error::SQLExecuteError;

This class is raised when the sql has an error while executing

BUGS

Too early to know...

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 49:

You forgot a '=back' before '=head1'