Available DBI Drivers and Data Sources
#!/usr/bin/perl
use warnings;
use strict;
use DBI;
my @drivers=DBI->available_drivers('quiet');
my @sources;
foreach my $driver (@drivers) {
print "$driver\n";
@sources=eval {
DBI->data_sources($driver)
};
if ($@) {
print "\tError: ",substr($@,0,60),"\n";
} elsif (@sources) {
foreach (@sources) {
print "\t$_\n";
}
} else {
print "\tNo known data sources\n";
}
}
Related examples in the same category