src/org/objectweb/cjdbc/controller/backup/OctopusConstants.java

説明を見る。
00001 00025 package org.objectweb.cjdbc.controller.backup; 00026 00027 import java.util.Hashtable; 00028 00034 public final class OctopusConstants 00035 { 00036 static final int FROM_URL = 0; 00037 static final int DRIVER = 1; 00038 static final int FULL_NAME = 2; 00039 static final int PREFIX_URL = 3; 00040 00041 // four values ... this is REALLY dirty but I see no other way to deal with 00042 // octopus constants ... 00043 // 1. If we parse the url, what can describe the db we're dealing with 00044 // 2. In octopus specific conf file, <Driver name="hsql"> 00045 // 3. In octopus general vendors file, what driver are we using ... 00046 // 4. the part of the url, octopus adds up automatically, from conf file 00047 00048 static final String[] HSQL = {"hsqldb", "hsql", "HypersonicSQL", 00049 "jdbc:hsqldb:" }; 00050 static final String[] CSV = {"csv", "csv", "Csv", "jdbc:relique:csv:"}; 00051 static final String[] MYSQL = {"mysql", "mm", "MySQL", "jdbc:mysql://"}; 00052 static final String[] POSTGRESQL = {"postgresql", "postgresql", 00053 "PostgreSQL", "jdbc:postgresql://"}; 00054 static final String[] ORACLE = {"oracle", "oracle", "Oracle", 00055 "jdbc:oracle:thin:" }; 00056 static final String[] JTURBO = {"jTurbo", "jTurbo", "MSQL", 00057 "jdbc:JTurbo://" }; 00058 static final String[] MSSQL = {"microsoft", "microsoft", "MSQL", 00059 "jdbc:microsoft:sqlserver://" }; 00060 00061 static final Hashtable TYPES; 00062 static 00063 { 00064 TYPES = new Hashtable(); 00065 TYPES.put(HSQL[0], HSQL); 00066 TYPES.put(CSV[0], CSV); 00067 TYPES.put(MYSQL[0], MYSQL); 00068 TYPES.put(ORACLE[0], ORACLE); 00069 TYPES.put(POSTGRESQL[0], POSTGRESQL); 00070 TYPES.put(JTURBO[0], JTURBO); 00071 TYPES.put(MSSQL[0], MSSQL); 00072 } 00073 00080 public static String getOctopusType(String type) 00081 { 00082 if (type == null) 00083 return null; 00084 return ((String[]) TYPES.get(type))[FULL_NAME]; 00085 } 00086 00093 public static String getOctopusDriver(String type) 00094 { 00095 if (type == null) 00096 return null; 00097 return ((String[]) TYPES.get(type))[DRIVER]; 00098 } 00099 00106 public static String getUrlPrefix(String type) 00107 { 00108 if (type == null) 00109 return null; 00110 return ((String[]) TYPES.get(type))[PREFIX_URL]; 00111 } 00112 00113 }

CJDBCversion1.0.4に対してTue Oct 12 15:16:00 2004に生成されました。 doxygen 1.3.8