{"action":"created","issue":{"url":"https://api.github.com/repos/jdbi/jdbi/issues/278","repository_url":"https://api.github.com/repos/jdbi/jdbi","labels_url":"https://api.github.com/repos/jdbi/jdbi/issues/278/labels{/name}","comments_url":"https://api.github.com/repos/jdbi/jdbi/issues/278/comments","events_url":"https://api.github.com/repos/jdbi/jdbi/issues/278/events","html_url":"https://github.com/jdbi/jdbi/issues/278","id":132094683,"number":278,"title":"Make ConnectionFactory accesible","user":{"login":"orangecoding","id":1519704,"avatar_url":"https://avatars.githubusercontent.com/u/1519704?v=3","gravatar_id":"","url":"https://api.github.com/users/orangecoding","html_url":"https://github.com/orangecoding","followers_url":"https://api.github.com/users/orangecoding/followers","following_url":"https://api.github.com/users/orangecoding/following{/other_user}","gists_url":"https://api.github.com/users/orangecoding/gists{/gist_id}","starred_url":"https://api.github.com/users/orangecoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orangecoding/subscriptions","organizations_url":"https://api.github.com/users/orangecoding/orgs","repos_url":"https://api.github.com/users/orangecoding/repos","events_url":"https://api.github.com/users/orangecoding/events{/privacy}","received_events_url":"https://api.github.com/users/orangecoding/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-08T09:48:12Z","updated_at":"2016-02-08T09:48:56Z","closed_at":null,"body":"Hi,\r\n\r\nI was struggeling with the problem, that I needed to check whether the database is available on startup. If it is not available, I'd check in a loop and continue starting the app if the db is reachable.\r\n\r\nCurrently I'm doing this for checks\r\n\r\n> `public boolean checkForConnection() {\r\nHandle handle = null;\r\ntry {\r\n  jdbi = factory.build(environment, config.getDatabaseFactory(), \"postgresql\");\r\n   handle = jdbi.open();\r\n} catch (Exception e) {\r\n  LOGGER.error(\"Error while checking Postgres connection.\");\r\n  return false;\r\n} finally {\r\n  try {\r\n    if(handle != null){\r\n      handle.close();\r\n    }\r\n  } catch (Exception e){\r\n    LOGGER.error(\"Error trying to close connection\");\r\n    return false;\r\n  }\r\n}\r\nreturn true;\r\n}`\r\n\r\nIt would be much easier to make `ConnectionFactory` accessible to check for connection."},"comment":{"url":"https://api.github.com/repos/jdbi/jdbi/issues/comments/181280912","html_url":"https://github.com/jdbi/jdbi/issues/278#issuecomment-181280912","issue_url":"https://api.github.com/repos/jdbi/jdbi/issues/278","id":181280912,"user":{"login":"orangecoding","id":1519704,"avatar_url":"https://avatars.githubusercontent.com/u/1519704?v=3","gravatar_id":"","url":"https://api.github.com/users/orangecoding","html_url":"https://github.com/orangecoding","followers_url":"https://api.github.com/users/orangecoding/followers","following_url":"https://api.github.com/users/orangecoding/following{/other_user}","gists_url":"https://api.github.com/users/orangecoding/gists{/gist_id}","starred_url":"https://api.github.com/users/orangecoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orangecoding/subscriptions","organizations_url":"https://api.github.com/users/orangecoding/orgs","repos_url":"https://api.github.com/users/orangecoding/repos","events_url":"https://api.github.com/users/orangecoding/events{/privacy}","received_events_url":"https://api.github.com/users/orangecoding/received_events","type":"User","site_admin":false},"created_at":"2016-02-08T09:48:56Z","updated_at":"2016-02-08T09:48:56Z","body":"mhm. for some reason, it doesn't format the code correctly :-/"}}