3 |
# $Id$ |
# $Id$ |
4 |
# |
# |
5 |
# $Log$ |
# $Log$ |
6 |
|
# Revision 1.12 2003/01/30 22:28:21 joko |
7 |
|
# + implemented new concrete methods |
8 |
|
# |
9 |
# Revision 1.11 2002/12/19 16:31:05 joko |
# Revision 1.11 2002/12/19 16:31:05 joko |
10 |
# + sub dropDb |
# + sub dropDb |
11 |
# + sub rebuildDb |
# + sub rebuildDb |
316 |
return $res; |
return $res; |
317 |
} |
} |
318 |
|
|
319 |
|
sub testAvailability { |
320 |
|
my $self = shift; |
321 |
|
my $status = $self->testDsn(); |
322 |
|
$self->{locator}->{status}->{available} = $status; |
323 |
|
return $status; |
324 |
|
} |
325 |
|
|
326 |
|
sub testDsn { |
327 |
|
my $self = shift; |
328 |
|
my $dsn = $self->{locator}->{dbi}->{dsn}; |
329 |
|
my $result; |
330 |
|
if ( my $dbh = DBI->connect($dsn, '', '', { |
331 |
|
PrintError => 0, |
332 |
|
} ) ) { |
333 |
|
|
334 |
|
# TODO: REVIEW |
335 |
|
$dbh->disconnect(); |
336 |
|
|
337 |
|
return 1; |
338 |
|
} else { |
339 |
|
$logger->warning( __PACKAGE__ . "[$self->{locator}->{type}]" . "->testDsn(): " . "DBI-error: " . $DBI::errstr ); |
340 |
|
} |
341 |
|
} |
342 |
|
|
343 |
1; |
1; |
344 |
|
__END__ |