KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > polepos > teams > jdbc > JdbcTeam


1 /*
2 This file is part of the PolePosition database benchmark
3 http://www.polepos.org
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public
16 License along with this program; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 MA 02111-1307, USA. */

19
20 package org.polepos.teams.jdbc;
21
22 import org.polepos.framework.*;
23
24
25 public class JdbcTeam extends Team{
26     
27     private final Car[] mCars;
28     
29     public JdbcTeam(){
30         
31         String JavaDoc[] dbs = Jdbc.settings().getJdbcTypes();
32         mCars = new Car[ dbs.length ];
33         
34         for( int i = 0; i < dbs.length; i++ ){
35             try {
36                 mCars[i] = new JdbcCar(dbs[ i ] );
37             } catch (CarMotorFailureException e) {
38                 mCars[i] = null;
39             }
40         }
41     }
42     
43     @Override JavaDoc
44     public String JavaDoc name(){
45         return "JDBC";
46     }
47     
48     @Override JavaDoc
49     public String JavaDoc description() {
50         return "all JDBC databases registered in Jdbc.properties";
51     }
52
53     @Override JavaDoc
54     public Car[] cars(){
55         return mCars;
56     }
57
58     @Override JavaDoc
59     public Driver[] drivers() {
60         return new Driver[]{
61             new MelbourneJdbc(),
62             new SepangJdbc(),
63             new BahrainJdbc(),
64             new ImolaJdbc(),
65             new BarcelonaJdbc()
66         };
67     }
68     
69     @Override JavaDoc
70     public String JavaDoc website() {
71         return null;
72     }
73
74
75 }
76
Popular Tags