Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public static Database getInstance()
  2. {
  3. if( instance == null )
  4. {
  5. return instanceNotFoundDoubleCheckSynced();
  6. }
  7. return instance;
  8. }
  9.  
  10.  
  11. synchronized private static Database instanceNotFoundDoubleCheckSynced()
  12. {
  13. if( instance == null )
  14. {
  15. Connection connection = establishConnection();
  16. if( connection != null )
  17. {
  18. instance = new Database( connection );
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement