1 23 24 package com.sun.gjc.common; 25 26 import java.util.Hashtable ; 27 28 35 public class DataSourceSpec implements java.io.Serializable { 36 37 public static final int USERNAME = 1; 38 public static final int PASSWORD = 2; 39 public static final int URL = 3; 40 public static final int LOGINTIMEOUT = 4; 41 public static final int LOGWRITER = 5; 42 public static final int DATABASENAME = 6; 43 public static final int DATASOURCENAME = 7; 44 public static final int DESCRIPTION = 8; 45 public static final int NETWORKPROTOCOL = 9; 46 public static final int PORTNUMBER = 10; 47 public static final int ROLENAME = 11; 48 public static final int SERVERNAME = 12; 49 public static final int MAXSTATEMENTS = 13; 50 public static final int INITIALPOOLSIZE = 14; 51 public static final int MINPOOLSIZE = 15; 52 public static final int MAXPOOLSIZE = 16; 53 public static final int MAXIDLETIME = 17; 54 public static final int PROPERTYCYCLE = 18; 55 public static final int DRIVERPROPERTIES = 19; 56 public static final int CLASSNAME = 20; 57 public static final int DELIMITER = 21; 58 59 public static final int XADATASOURCE = 22; 60 public static final int DATASOURCE = 23; 61 public static final int CONNECTIONPOOLDATASOURCE = 24; 62 63 public static final int CONNECTIONVALIDATIONREQUIRED = 25; 65 public static final int VALIDATIONMETHOD = 26; 66 public static final int VALIDATIONTABLENAME = 27; 67 68 public static final int TRANSACTIONISOLATION = 28; 69 public static final int GUARANTEEISOLATIONLEVEL = 29; 70 71 private Hashtable details = new Hashtable (); 72 73 79 public void setDetail(int property, String value) { 80 details.put(new Integer (property),value); 81 } 82 83 88 public String getDetail(int property) { 89 if (details.containsKey(new Integer (property))) { 90 return (String ) details.get(new Integer (property)); 91 } else { 92 return null; 93 } 94 } 95 96 102 public boolean equals(Object obj) { 103 if (obj instanceof DataSourceSpec) { 104 return this.details.equals(((DataSourceSpec)obj).details); 105 } 106 return false; 107 } 108 109 114 public int hashCode() { 115 return this.details.hashCode(); 116 } 117 } 118 | Popular Tags |