File Coverage

blib/lib/ODO/DB.pm
Criterion Covered Total %
statement 27 32 84.3
branch n/a
condition n/a
subroutine 9 10 90.0
pod n/a
total 36 42 85.7


line stmt bran cond sub pod time code
1             #
2             # Copyright (c) 2004-2006 IBM Corporation.
3             #
4             # All rights reserved. This program and the accompanying materials
5             # are made available under the terms of the Eclipse Public License v1.0
6             # which accompanies this distribution, and is available at
7             # http://www.eclipse.org/legal/epl-v10.html
8             #
9             # File: $Source: /var/lib/cvs/ODO/lib/ODO/DB.pm,v $
10             # Created by: Stephen Evanchik( evanchik@us.ibm.com )
11             # Created on: 10/05/2004
12             # Revision: $Id: DB.pm,v 1.2 2009-11-25 17:46:51 ubuntu Exp $
13             #
14             # Contributors:
15             # IBM Corporation - initial API and implementation
16             #
17             package ODO::DB;
18              
19              
20             package ODO::DBI::Connector;
21              
22 1     1   55134 use strict;
  1         3  
  1         36  
23 1     1   5 use warnings;
  1         2  
  1         31  
24              
25 1     1   526 use ODO::Exception;
  1         3  
  1         73  
26 1     1   1256 use Exception::Class::DBI;
  1         5098  
  1         23  
27              
28 1     1   88 use vars qw /$VERSION/;
  1         2  
  1         100  
29             $VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /: (\d+)\.(\d+)/;
30              
31 1     1   6 use base qw/DBI/;
  1         2  
  1         28522  
32              
33              
34             =head1 NAME
35              
36             ODO::DBI::Connector
37              
38             =head1 SYNOPSIS
39              
40             =head1 DESCRIPTION
41            
42             =head1 METHODS
43              
44             =over
45              
46             =back
47              
48             =head1 COPYRIGHT
49              
50             Copyright (c) 2004-2006 IBM Corporation.
51              
52             All rights reserved. This program and the accompanying materials
53             are made available under the terms of the Eclipse Public License v1.0
54             which accompanies this distribution, and is available at
55             http://www.eclipse.org/legal/epl-v10.html
56            
57             =cut
58              
59             package ODO::DBI::Connector::dr;
60              
61 1     1   29050 use base qw/DBI::dr/;
  1         2  
  1         861  
62              
63             sub connect {
64 0     0     my ($drh, $dsn, $user, $pass, $attr) = @_;
65            
66             # Setup the DBI to use Exception::Class::DBI
67 0           $attr->{PrintError} = 0;
68 0           $attr->{RaiseError} = 0;
69 0           $attr->{HandleError} = Exception::Class::DBI->handler();
70            
71 0           return $drh->SUPER::connect($dsn, $user, $pass, $attr);
72             }
73              
74             package ODO::DBI::Connector::db;
75              
76 1     1   8 use base qw/DBI::db/;
  1         2  
  1         646  
77              
78              
79             package ODO::DBI::Connector::st;
80              
81 1     1   8 use base qw/DBI::st/;
  1         3  
  1         585  
82              
83              
84             1;
85              
86             __END__