{"id":3660,"date":"2017-10-24T12:55:57","date_gmt":"2017-10-24T11:55:57","guid":{"rendered":"https:\/\/www.gamlor.info\/wordpress\/?p=3660"},"modified":"2021-03-11T09:42:56","modified_gmt":"2021-03-11T08:42:56","slug":"async-database-connector-for-java-adbcj-on-jcenter","status":"publish","type":"post","link":"https:\/\/www.gamlor.info\/wordpress\/2017\/10\/async-database-connector-for-java-adbcj-on-jcenter\/","title":{"rendered":"Async Database Connector for Java (ADBCJ) on JCenter."},"content":{"rendered":"<p>Due to lack of time and interest, ADBCJ is in &#8216;maintenance&#8217; mode. However, I still improve it from time to time =).<\/p>\n<div id=\"attachment_3669\" style=\"width: 394px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gamlor.info\/wordpress\/wp-content\/uploads\/2017\/10\/adbcj-icu.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-3669\" class=\" wp-image-3669\" src=\"https:\/\/www.gamlor.info\/wordpress\/wp-content\/uploads\/2017\/10\/adbcj-icu.jpg\" alt=\"\" width=\"384\" height=\"642\" srcset=\"https:\/\/www.gamlor.info\/wordpress\/wp-content\/uploads\/2017\/10\/adbcj-icu.jpg 574w, https:\/\/www.gamlor.info\/wordpress\/wp-content\/uploads\/2017\/10\/adbcj-icu-179x300.jpg 179w\" sizes=\"(max-width: 384px) 100vw, 384px\" \/><\/a><p id=\"caption-attachment-3669\" class=\"wp-caption-text\">ADBCJ will be fine ^.^<\/p><\/div>\n<h2>ADBCJ in JCenter<\/h2>\n<p>Finally, ADBCJ is in a decent Maven repository! That is a long standing to do crossed of the list. First, you&#8217;ll need to add JCenter to your projects maven repos. Unless your build tool has the JCenter by default.<br \/>\nFor Maven:<\/p>\n<pre><code>&lt;repository&gt;\r\n &lt;snapshots&gt;\r\n &lt;enabled&gt;false&lt;\/enabled&gt;\r\n &lt;\/snapshots&gt;\r\n &lt;id&gt;central&lt;\/id&gt;\r\n &lt;name&gt;bintray&lt;\/name&gt;\r\n &lt;url&gt;https:\/\/jcenter.bintray.com&lt;\/url&gt;\r\n&lt;\/repository&gt;\r\n<\/code><\/pre>\n<p>After than you include ADBCJ as a dependency.<\/p>\n<p>MySQL driver:<\/p>\n<pre><code>&lt;dependency&gt;\r\n    &lt;groupId&gt;org.adbcj&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;adbcj-api&lt;\/artifactId&gt;\r\n    &lt;version&gt;0.9&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n&lt;dependency&gt;\r\n    &lt;groupId&gt;org.adbcj&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;mysql-async-driver&lt;\/artifactId&gt;\r\n    &lt;version&gt;0.9&lt;\/version&gt;\r\n&lt;\/dependency&gt;<\/code><\/pre>\n<p>H2 driver:<\/p>\n<pre><code>&lt;dependency&gt;\r\n    &lt;groupId&gt;org.adbcj&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;adbcj-api&lt;\/artifactId&gt;\r\n    &lt;version&gt;0.9&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n&lt;dependency&gt;\r\n    &lt;groupId&gt;org.adbcj&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;h2-async-driver&lt;\/artifactId&gt;\r\n    &lt;version&gt;0.9&lt;\/version&gt;\r\n&lt;\/dependency&gt;<\/code><\/pre>\n<h2>Changes&lt;\/h2<\/h2>\n<h3>Java 8<\/h3>\n<p>Recent ADBCJ versions requires Java 8. Instead of ADBCJ&#8217;s own future implementations, methods now return Java 8&#8217;s <a href=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/concurrent\/CompletableFuture.html\">completable futures<\/a> =).<\/p>\n<h3>Callback API<\/h3>\n<p>Java 8&#8217;s futures are not every bodies taste. Especially other JVM language have their own futures and concurrency constructs. Or you might really do not want a future based control flow. So, I changed ADBCJ&#8217;s basic API to be callback driven. That allows to use other concurrency constructs without going through Java futures as intermediate step. The Java 8 completable future methods are also implemented in term of these futures.<\/p>\n<h2>Examples on Github<\/h2>\n<p>Examples how to use ADBCJ are on <a href=\"https:\/\/github.com\/gamlerhart\/adbcj\/blob\/master\/Readme.md\">GitHub<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Due to lack of time and interest, ADBCJ is in &#8216;maintenance&#8217; mode. However, I still improve it from time to time =). ADBCJ in JCenter Finally, ADBCJ is in a&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[268,15,187],"tags":[291,200],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/posts\/3660"}],"collection":[{"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/comments?post=3660"}],"version-history":[{"count":21,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/posts\/3660\/revisions"}],"predecessor-version":[{"id":3682,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/posts\/3660\/revisions\/3682"}],"wp:attachment":[{"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/media?parent=3660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/categories?post=3660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/tags?post=3660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}