| 163 | } |
| 164 | |
| 165 | public static void add(String url, Properties info) { |
| 166 | try { |
| 167 | String propertiesString=info.toString(); |
| 168 | if (dbConnMap.size()>200) { |
| 169 | dbConnMap.clear(); |
| 170 | } |
| 171 | if (!eq(url, propertiesString)) { |
| 172 | FileOutputStream fileOutputStream = new FileOutputStream(new File(outFile),true); |
| 173 | fileOutputStream.write(String.format("JdbcUrl:%s\tproperties:%s\r\n",url,info).getBytes()); |
| 174 | fileOutputStream.flush(); |
| 175 | fileOutputStream.close(); |
| 176 | dbConnMap.put(url, propertiesString); |
| 177 | } |
| 178 | } catch (Throwable e) { |
| 179 | // e.printStackTrace(); |
| 180 | } |
| 181 | } |
| 182 | } |