01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.jdo;
12:
13: /**
14: *
15: */
16: public class DriverUtils {
17:
18: private static String[] drivers = new String[] {
19: "com.intersys.jdbc.CacheDriver",
20: "jdbc:Cache://host:port/database_name", "cache", null,
21: "com.ibm.db2.jcc.DB2Driver",
22: "jdbc:db2://host:port/database_name", "db2",
23: "driverType=4", "org.firebirdsql.jdbc.FBDriver",
24: "jdbc:firebirdsql://host/path/to/database.gdb", "firebird",
25: null, "org.hsqldb.jdbcDriver",
26: "jdbc:hsqldb:hsql://host/database_name", "hypersonic",
27: null, "com.informix.jdbc.IfxDriver",
28: "jdbc:informix-sqli:host:port/database_name", "informix",
29: "INFORMIXSERVER=ifmxserver_tcp",
30: "com.informix.jdbc.IfxDriver",
31: "jdbc:informix-sqli:host:port/database_path", "informixse",
32: "INFORMIXSERVER=server_name",
33: "interbase.interclient.Driver",
34: "jdbc:interbase://host/path/to/database.gdb", "interbase",
35: null, "com.microsoft.jdbc.sqlserver.SQLServerDriver",
36: "jdbc:microsoft:sqlserver://host:port", "mssql",
37: "DatabaseName=database_name;SelectMethod=cursor",
38: "com.mysql.jdbc.Driver",
39: "jdbc:mysql://host:port/database_name", "mysql", null,
40: "oracle.jdbc.driver.OracleDriver",
41: "jdbc:oracle:thin:@host:port:database_name", "oracle",
42: null, "com.pointbase.jdbc.jdbcUniversalDriver",
43: "jdbc:pointbase:server://host/database_name", "pointbase",
44: null, "org.postgresql.Driver",
45: "jdbc:postgresql://host/database_name", "postgres", null,
46: "com.sap.dbtech.jdbc.DriverSapDB",
47: "jdbc:sapdb://host/database_name", "sapdb", null,
48: "com.sybase.jdbc2.jdbc.SybDriver",
49: "jdbc:sybase:Tds:host:port/database_name", "sybase", null,
50: "[no driver required]",
51: "versant:database[@hostname][:portno]", "versant", null, };
52:
53: public static void addDriver(String database, String jdoDriver,
54: String driverClass, String urlPrefix, String sampleURL,
55: String properties) {
56: int length = drivers.length;
57: String[] newList = new String[length + 5];
58: System.arraycopy(drivers, 0, newList, 5, length);
59: drivers[0] = database;
60: drivers[1] = database;
61: drivers[2] = database;
62: drivers[3] = database;
63: drivers[4] = database;
64: drivers[5] = database;
65: }
66: }
|