KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdo > DriverUtils


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
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  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.jdo;
13
14 /**
15  *
16  */

17 public class DriverUtils {
18
19     private static String JavaDoc[] drivers = new String JavaDoc[]{
20         "com.intersys.jdbc.CacheDriver",
21         "jdbc:Cache://host:port/database_name",
22         "cache",
23         null,
24         "com.ibm.db2.jcc.DB2Driver",
25         "jdbc:db2://host:port/database_name",
26         "db2",
27         "driverType=4",
28         "org.firebirdsql.jdbc.FBDriver",
29         "jdbc:firebirdsql://host/path/to/database.gdb",
30         "firebird",
31         null,
32         "org.hsqldb.jdbcDriver",
33         "jdbc:hsqldb:hsql://host/database_name",
34         "hypersonic",
35         null,
36         "com.informix.jdbc.IfxDriver",
37         "jdbc:informix-sqli:host:port/database_name",
38         "informix",
39         "INFORMIXSERVER=ifmxserver_tcp",
40         "com.informix.jdbc.IfxDriver",
41         "jdbc:informix-sqli:host:port/database_path",
42         "informixse",
43         "INFORMIXSERVER=server_name",
44         "interbase.interclient.Driver",
45         "jdbc:interbase://host/path/to/database.gdb",
46         "interbase",
47         null,
48         "com.microsoft.jdbc.sqlserver.SQLServerDriver",
49         "jdbc:microsoft:sqlserver://host:port",
50         "mssql",
51         "DatabaseName=database_name;SelectMethod=cursor",
52         "com.mysql.jdbc.Driver",
53         "jdbc:mysql://host:port/database_name",
54         "mysql",
55         null,
56         "oracle.jdbc.driver.OracleDriver",
57         "jdbc:oracle:thin:@host:port:database_name",
58         "oracle",
59         null,
60         "com.pointbase.jdbc.jdbcUniversalDriver",
61         "jdbc:pointbase:server://host/database_name",
62         "pointbase",
63         null,
64         "org.postgresql.Driver",
65         "jdbc:postgresql://host/database_name",
66         "postgres",
67         null,
68         "com.sap.dbtech.jdbc.DriverSapDB",
69         "jdbc:sapdb://host/database_name",
70         "sapdb",
71         null,
72         "com.sybase.jdbc2.jdbc.SybDriver",
73         "jdbc:sybase:Tds:host:port/database_name",
74         "sybase",
75         null,
76         "[no driver required]",
77         "versant:database[@hostname][:portno]",
78         "versant",
79         null,
80     };
81
82     public static void addDriver(String JavaDoc database, String JavaDoc jdoDriver, String JavaDoc driverClass,
83             String JavaDoc urlPrefix, String JavaDoc sampleURL, String JavaDoc properties) {
84         int length = drivers.length;
85         String JavaDoc[] newList = new String JavaDoc[length + 5];
86         System.arraycopy(drivers, 0, newList, 5, length);
87         drivers[0] = database;
88         drivers[1] = database;
89         drivers[2] = database;
90         drivers[3] = database;
91         drivers[4] = database;
92         drivers[5] = database;
93     }
94 }
95
Popular Tags