1 26 package org.objectweb.jonas.jdbc; 27 28 import java.util.Enumeration ; 29 import java.util.Properties ; 30 31 public class MCFData { 32 33 34 Properties mcfData = null; 35 36 public static String dsMethodNames[] = { 37 "setDSClass", 38 "setDbSpecificMethods", 39 "setDatabaseName", 40 "setDataSourceName", 41 "setDescription", 42 "setPortNumber", 43 "setServerName", 44 "setURL", 45 "setUser", 46 "setPassword", 47 "setLoginTimeout", 48 "setIsolationLevel", 49 "setInitialPoolSize", 50 "setMinPoolSize", 51 "setMaxIdleTime", 52 "setMaxPoolSize", 53 "setMaxStatements", 54 "setPropertyCycle", 55 "setMapperName", 56 "setLogTopic", 57 "setConnCheckLevel", 58 "setConnMaxAge", 59 "setConnTestStmt", 60 }; 61 public static final int DSCLASS = 0; 63 public static final int DBSPECIFICMETHODS = 1; 64 public static final int DATABASENAME = 2; 65 public static final int DATASOURCENAME = 3; 66 public static final int DESCRIPTION = 4; 67 public static final int PORTNUMBER = 5; 68 public static final int SERVERNAME = 6; 69 public static final int URL = 7; 70 public static final int USER = 8; 71 public static final int PASSWORD = 9; 72 public static final int LOGINTIMEOUT = 10; 73 public static final int ISOLATIONLEVEL = 11; 74 75 public static final int INITIALPOOLSIZE = 12; 77 public static final int MINPOOLSIZE = 13; 78 public static final int MAXIDLETIME = 14; 79 public static final int MAXPOOLSIZE = 15; 80 public static final int MAXSTATEMENTS = 16; 81 public static final int PROPERTYCYCLE = 17; 82 83 public static final int JONASOFFSET = 17; 85 86 public static final int MAPPERNAME = 18; 89 90 public static final int LOGTOPIC = 19; 92 93 public static final int CONNCHECKLEVEL = 20; 95 public static final int CONNMAXAGE = 21; 96 public static final int CONNTESTSTMT = 22; 97 98 99 public MCFData() { 100 mcfData = new Properties (); 101 } 102 103 104 public boolean equals(Object obj) { 105 if (obj instanceof MCFData) { 106 return mcfData.equals(((MCFData)obj).mcfData); 107 } else { 108 return false; 109 } 110 } 111 112 113 public String getMCFData(int prop) { 114 return mcfData.getProperty(""+prop); 115 } 116 117 public int hashCode() { 118 return mcfData.hashCode(); 119 } 120 121 122 public void setMCFData(int prop, String val) { 123 mcfData.setProperty(""+prop, val); 124 } 125 126 public String getProperty(String key) { 127 return mcfData.getProperty(key); 128 } 129 130 public Enumeration getProperties() { 131 return mcfData.propertyNames(); 132 } 133 134 } | Popular Tags |