1 21 22 package org.apache.derby.iapi.jdbc; 23 24 import java.util.Properties ; 25 import java.util.Enumeration ; 26 import java.util.Map ; 27 import java.util.HashMap ; 28 import java.sql.SQLClientInfoException ; 29 import java.sql.ClientInfoStatus ; 30 31 40 public class FailedProperties40 { 41 private final HashMap <String ,ClientInfoStatus > failedProps_ = 42 new HashMap <String ,ClientInfoStatus >(); 43 private final String firstKey_; 44 private final String firstValue_; 45 46 53 public static Properties makeProperties(String name, String value) { 54 Properties p = new Properties (); 55 if (name != null || value != null) 56 p.setProperty(name, value); 57 return p; 58 } 59 68 public FailedProperties40(Properties props) { 69 if (props == null || props.isEmpty()) { 70 firstKey_ = null; 71 firstValue_ = null; 72 return; 73 } 74 Enumeration e = props.keys(); 75 firstKey_ = (String )e.nextElement(); 76 firstValue_ = props.getProperty(firstKey_); 77 failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY); 78 while (e.hasMoreElements()) { 79 failedProps_.put((String )e.nextElement(), 80 ClientInfoStatus.REASON_UNKNOWN_PROPERTY); 81 } 82 } 83 84 93 public Map <String ,ClientInfoStatus > getProperties() { return failedProps_; } 94 95 102 public String getFirstKey() { return firstKey_; } 103 104 111 public String getFirstValue() { return firstValue_; } 112 } 113 | Popular Tags |