Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

DBI driver name from database handle

by liz (Monsignor)
on Oct 20, 2003 at 14:42 UTC ( #300599=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package External;
    sub dbh { $External::dbh ||= DBI->connect( 'DBI:mysql:test','root','' 
    +) } #dbh
    
  2. or download this
    package Foo;
    sub new {
    ...
        bless {},__PACKAGE__.'::'.$driver;
    }
    sub general { same for all database drivers }
    
  3. or download this
    package Foo::mysql;
    @ISA = qw(Foo);
    sub specific { stuff specific to MySQL }
    
  4. or download this
    $dbh->{Driver}{Name};  # gives "mysql"
    $dbh->get_info( 17 );  # gives "MySQL"
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://300599]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-12-20 03:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls