{{theTime}}

Search This Blog

Total Pageviews

How to synchronize TreeMap?

TreeMap implementation is not synchronized.   If multiple threads access TreeMap and atleast one thread updates the TreeMap, it must be synchronized externally.  If no external synchronization, use 

 SortedMap m = Collections.synchronizedSortedMap(new TreeMap(...));

No comments:

Mysql - java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed

Add allowPublicKeyRetrieval=true to the JDBC URL. jdbc:mysql://localhost:3306/db?allowPublicKeyRetrieval=true&useSSL=false