Get a database handle

From ClassDBI

Jump to: navigation, search

How do you get a $dbh from your CDBI object?

In your script:

 my $dbi = $class->db_Main()

or in your class file

 my $dbi = __PACKAGE__->db_Main()

Class::DBI inherits from Ima::DBI; Ima::DBI creates the "db_Main" method when Class::DBI::connection() calls Ima::DBI's set_db().

Since Class::DBI explicitly names the connection "Main", the method is called "db_Main".

Personal tools