private string getDatabase(string NETConnectionStr) { char[] sp = new char[] { ';' }; string[] segment = NETConnectionStr.Split(sp); // ConcurrentHashMap <string, string> map = new ConcurrentHashMap <string, string>(); foreach (string sg in segment) { char[] sgp = new char[] { '=' }; string[] s = sg.Split(sgp); //无密码时参数就1个长度 if (s.Length == 1) { map.put(s[0].Trim(), ""); } else { map.put(s[0].Trim(), s[1]); } } // database = map.get("database").ToString(); return(database); }
public static Map <QName, XMLEventParser> getDefaultParsers() { ConcurrentHashMap <QName, XMLEventParser> parsers = new ConcurrentHashMap <QName, XMLEventParser>(); String ans = AtomConstants.ATOM_NAMESPACE; parsers.put(new QName(ans, "author"), new AtomPerson(ans)); parsers.put(new QName(ans, "link"), new AtomLink(ans)); StringXMLEventParser stringParser = new StringXMLEventParser(); foreach (String s in StringFields) { parsers.put(new QName(ans, s), stringParser); } return(parsers); }
/** * java * "jdbc:mysql://localhost:3306/mysql?user=root&password=12345678" * * .net * server=127.0.0.1;Port=3306; * user id=root; password=NVfaQnXAZJaQJhW7; * database=ultrax; pooling=false;charset=utf8 */ private string convertPathToJDBC(string NETConnectionStr) { char[] sp = new char[] { ';' }; string[] segment = NETConnectionStr.Split(sp); // string JDBCConnectionStr = "jdbc:" + sql + "://"; // ConcurrentHashMap <string, string> map = new ConcurrentHashMap <string, string>(); foreach (string sg in segment) { char[] sgp = new char[] { '=' }; string[] s = sg.Split(sgp); //无密码时参数就1个长度 if (s.Length == 1) { map.put(s[0].Trim(), ""); } else { map.put(s[0].Trim(), s[1]); } } // JDBCConnectionStr += map.get("server"); JDBCConnectionStr += ":" + map.get("Port") + "/"; JDBCConnectionStr += map.get("database") + "?user="******"database").ToString(); JDBCConnectionStr += map.get("user id") + "&password="******"password") + "&charset="; JDBCConnectionStr += map.get("charset"); return(JDBCConnectionStr); }
public static Map <QName, XMLEventParser> getDefaultParsers() { ConcurrentHashMap <QName, XMLEventParser> parsers = new ConcurrentHashMap <QName, XMLEventParser>(); String ns = GXConstants.GX_NAMESPACE; parsers.put(new QName(ns, "AnimatedUpdate"), new GXAnimatedUpdate(ns)); parsers.put(new QName(ns, "FlyTo"), new GXFlyTo(ns)); parsers.put(new QName(ns, "LatLonQuad"), new GXLatLongQuad(ns)); parsers.put(new QName(ns, "Playlist"), new GXPlaylist(ns)); parsers.put(new QName(ns, "SoundCue"), new GXSoundCue(ns)); parsers.put(new QName(ns, "TimeSpan"), new KMLTimeSpan(ns)); parsers.put(new QName(ns, "TimeStamp"), new KMLTimeStamp(ns)); parsers.put(new QName(ns, "Tour"), new GXTour(ns)); parsers.put(new QName(ns, "TourControl"), new GXTourControl(ns)); parsers.put(new QName(ns, "Wait"), new GXWait(ns)); StringXMLEventParser stringParser = new StringXMLEventParser(); foreach (String s in StringFields) { parsers.put(new QName(ns, s), stringParser); } DoubleXMLEventParser doubleParser = new DoubleXMLEventParser(); foreach (String s in DoubleFields) { parsers.put(new QName(ns, s), doubleParser); } BooleanXMLEventParser booleanParser = new BooleanXMLEventParser(); foreach (String s in BooleanFields) { parsers.put(new QName(ns, s), booleanParser); } return(parsers); }
public static Map <QName, XMLEventParser> getDefaultParsers() { ConcurrentHashMap <QName, XMLEventParser> parsers = new ConcurrentHashMap <QName, XMLEventParser>(); String xns = XALConstants.XAL_NAMESPACE; parsers.put(new QName(xns, "Address"), new XALAddress(xns)); parsers.put(new QName(xns, "AddressDetails"), new XALAddressDetails(xns)); parsers.put(new QName(xns, "AddressLine"), new XALAddressLine(xns)); parsers.put(new QName(xns, "AddressLines"), new XALAddressLines(xns)); parsers.put(new QName(xns, "AdministrativeArea"), new XALAdministrativeArea(xns)); parsers.put(new QName(xns, "Country"), new XALCountry(xns)); parsers.put(new QName(xns, "CountryName"), new XALCountryName(xns)); parsers.put(new QName(xns, "CountryNameCode"), new XALCountryNameCode(xns)); parsers.put(new QName(xns, "Locality"), new XALLocality(xns)); parsers.put(new QName(xns, "PostalServiceElements"), new XALPostalServiceElements(xns)); parsers.put(new QName(xns, "Thoroughfare"), new XALThoroughfare(xns)); StringXMLEventParser stringParser = new StringXMLEventParser(); foreach (String s in StringFields) { parsers.put(new QName(xns, s), stringParser); } return(parsers); }