{"id":39102,"date":"2015-04-13T16:00:10","date_gmt":"2015-04-13T13:00:10","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=39102"},"modified":"2015-04-11T18:50:59","modified_gmt":"2015-04-11T15:50:59","slug":"how-to-flatmap-a-jdbc-resultset-with-java-8","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html","title":{"rendered":"How to FlatMap a JDBC ResultSet with Java 8?"},"content":{"rendered":"<p>You\u2019re not into the functional mood yet? Then the title might not resonate with you \u2013 but the article will! Trust me.<\/p>\n<p>Essentially, we want this:<\/p>\n<pre class=\" brush:bash\">+------+------+------+\r\n| col1 | col2 | col3 |\r\n+------+------+------+\r\n| A    | B    | C    | row 1\r\n| D    | E    | F    | row 2\r\n| G    | H    | I    | row 3\r\n+------+------+------+<\/pre>\n<p>to be \u201cflat mapped\u201d into this:<\/p>\n<pre class=\" brush:bash\">+------+\r\n| cols |\r\n+------+\r\n| A    |\\ \r\n| B    | | row 1\r\n| C    |\/\r\n| D    |\\\r\n| E    | | row 2\r\n| F    |\/\r\n| G    |\\\r\n| H    | | row 3\r\n| I    |\/\r\n+------+<\/pre>\n<h2>How to do it with Java 8?<\/h2>\n<p>It\u2019s easy, when you\u2019re using <a title=\"The Best Way to Write SQL in Java\" href=\"http:\/\/www.jooq.org\">jOOQ<\/a>. Let\u2019s create the database first:<\/p>\n<pre class=\" brush:sql\">CREATE TABLE t (\r\n  col1 VARCHAR2(1),\r\n  col2 VARCHAR2(1),\r\n  col3 VARCHAR2(1)\r\n);\r\n\r\nINSERT INTO t VALUES ('A', 'B', 'C');\r\nINSERT INTO t VALUES ('D', 'E', 'F');\r\nINSERT INTO t VALUES ('G', 'H', 'I');<\/pre>\n<p>Now let\u2019s add some jOOQ and Java 8!<\/p>\n<pre class=\" brush:java\">List&lt;String&gt; list =\r\nDSL.using(connection)\r\n   .fetch(\"SELECT col1, col2, col3 FROM t\")\r\n   .stream()\r\n   .flatMap(r -&gt; Arrays.stream(r.into(String[].class)))\r\n   .collect(Collectors.toList());\r\n\r\nSystem.out.println(list);<\/pre>\n<p>\u2026 and that\u2019s it! The output is:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\" brush:java\">[A, B, C, D, E, F, G, H, I]<\/pre>\n<p>(<a href=\"http:\/\/stackoverflow.com\/a\/25996727\/521799\">I\u2019ve also given this solution to this Stack Overflow question<\/a>)<\/p>\n<p>How do you read the above? Simply like this:<\/p>\n<pre class=\" brush:java\">List&lt;String&gt; list =\r\n\r\n\/\/ Get a Result&lt;Record&gt;, which is essentially a List\r\n\/\/ from the database query\r\nDSL.using(connection)\r\n   .fetch(\"SELECT col1, col2, col3 FROM t\")\r\n\r\n\/\/ Stream its records\r\n   .stream()\r\n\r\n\/\/ And generate a new stream of each record's String[]\r\n\/\/ representation, \"flat mapping\" that again into a\r\n\/\/ single stream\r\n   .flatMap(r -&gt; Arrays.stream(r.into(String[].class)))\r\n   .collect(Collectors.toList());<\/pre>\n<p>Note that if you\u2019re not using jOOQ to render and execute your query, you can still use jOOQ to transform the JDBC <code>ResultSet<\/code> into a jOOQ <code>Result<\/code> to produce the same output:<\/p>\n<pre class=\" brush:java\">try (ResultSet rs = ...) {\r\n    List&lt;String&gt; list =\r\n    DSL.using(connection)\r\n       .fetch(rs) \/\/ unwind the ResultSet here\r\n       .stream()\r\n       .flatMap(r -&gt; Arrays.stream(r.into(String[].class)))\r\n       .collect(Collectors.toList());\r\n\r\n    System.out.println(list);\r\n}<\/pre>\n<h2>Bonus: The SQL way<\/h2>\n<p>The SQL way to produce the same result is trivial:<\/p>\n<pre class=\" brush:sql\">SELECT col1 FROM t UNION ALL\r\nSELECT col2 FROM t UNION ALL\r\nSELECT col3 FROM t\r\nORDER BY 1<\/pre>\n<p>Or, of course, if you\u2019re using Oracle or SQL Server, you can use the magic UNPIVOT clause (<a title=\"Are You Using SQL PIVOT Yet? You Should!\" href=\"http:\/\/blog.jooq.org\/2014\/08\/05\/are-you-using-sql-pivot-yet-you-should\/\">the opposite of the PIVOT clause<\/a>):<\/p>\n<pre class=\" brush:sql\">SELECT c\r\nFROM t\r\nUNPIVOT (\r\n  c FOR col in (col1, col2, col3)\r\n)<\/pre>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/blog.jooq.org\/2015\/04\/09\/how-to-flatmap-a-jdbc-resultset-with-java-8\/\">How to FlatMap a JDBC ResultSet with Java 8?<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\/\">JCG partner<\/a> Lukas Eder at the <a href=\"http:\/\/blog.jooq.org\/\">JAVA, SQL, AND JOOQ<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>You\u2019re not into the functional mood yet? Then the title might not resonate with you \u2013 but the article will! Trust me. Essentially, we want this: +&#8212;&#8212;+&#8212;&#8212;+&#8212;&#8212;+ | col1 | col2 | col3 | +&#8212;&#8212;+&#8212;&#8212;+&#8212;&#8212;+ | A | B | C | row 1 | D | E | F | row 2 | G &hellip;<\/p>\n","protected":false},"author":68,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[196,491],"class_list":["post-39102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-java-8","tag-jdbc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to FlatMap a JDBC ResultSet with Java 8? - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"You\u2019re not into the functional mood yet? Then the title might not resonate with you \u2013 but the article will! Trust me. Essentially, we want this:\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to FlatMap a JDBC ResultSet with Java 8? - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"You\u2019re not into the functional mood yet? Then the title might not resonate with you \u2013 but the article will! Trust me. Essentially, we want this:\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-04-13T13:00:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Lukas Eder\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/JavaOOQ\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lukas Eder\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html\"},\"author\":{\"name\":\"Lukas Eder\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/2e5562e68acc527c00dbe1cc618081b2\"},\"headline\":\"How to FlatMap a JDBC ResultSet with Java 8?\",\"datePublished\":\"2015-04-13T13:00:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html\"},\"wordCount\":186,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"Java 8\",\"JDBC\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html\",\"name\":\"How to FlatMap a JDBC ResultSet with Java 8? - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2015-04-13T13:00:10+00:00\",\"description\":\"You\u2019re not into the functional mood yet? Then the title might not resonate with you \u2013 but the article will! Trust me. Essentially, we want this:\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/04\\\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to FlatMap a JDBC ResultSet with Java 8?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/2e5562e68acc527c00dbe1cc618081b2\",\"name\":\"Lukas Eder\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g\",\"caption\":\"Lukas Eder\"},\"description\":\"Lukas is a Java and SQL enthusiast developer. He created the Data Geekery GmbH. He is the creator of jOOQ, a comprehensive SQL library for Java, and he is blogging mostly about these three topics: Java, SQL and jOOQ.\",\"sameAs\":[\"http:\\\/\\\/blog.jooq.org\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/profile\\\/view?id=6409824\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/JavaOOQ\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Lukas-Eder\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to FlatMap a JDBC ResultSet with Java 8? - Java Code Geeks","description":"You\u2019re not into the functional mood yet? Then the title might not resonate with you \u2013 but the article will! Trust me. Essentially, we want this:","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html","og_locale":"en_US","og_type":"article","og_title":"How to FlatMap a JDBC ResultSet with Java 8? - Java Code Geeks","og_description":"You\u2019re not into the functional mood yet? Then the title might not resonate with you \u2013 but the article will! Trust me. Essentially, we want this:","og_url":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2015-04-13T13:00:10+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Lukas Eder","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/JavaOOQ","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Lukas Eder","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html"},"author":{"name":"Lukas Eder","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/2e5562e68acc527c00dbe1cc618081b2"},"headline":"How to FlatMap a JDBC ResultSet with Java 8?","datePublished":"2015-04-13T13:00:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html"},"wordCount":186,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["Java 8","JDBC"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html","url":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html","name":"How to FlatMap a JDBC ResultSet with Java 8? - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2015-04-13T13:00:10+00:00","description":"You\u2019re not into the functional mood yet? Then the title might not resonate with you \u2013 but the article will! Trust me. Essentially, we want this:","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2015\/04\/how-to-flatmap-a-jdbc-resultset-with-java-8.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"How to FlatMap a JDBC ResultSet with Java 8?"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/2e5562e68acc527c00dbe1cc618081b2","name":"Lukas Eder","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0539ed8cbcebfd5df5c2bd3048cf645d90f259da6851a005099b51edfd7a68e1?s=96&d=mm&r=g","caption":"Lukas Eder"},"description":"Lukas is a Java and SQL enthusiast developer. He created the Data Geekery GmbH. He is the creator of jOOQ, a comprehensive SQL library for Java, and he is blogging mostly about these three topics: Java, SQL and jOOQ.","sameAs":["http:\/\/blog.jooq.org\/","http:\/\/www.linkedin.com\/profile\/view?id=6409824","https:\/\/x.com\/http:\/\/twitter.com\/JavaOOQ"],"url":"https:\/\/www.javacodegeeks.com\/author\/Lukas-Eder"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/39102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=39102"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/39102\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=39102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=39102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=39102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}