<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Db on Micha Kops&#39; Tech Notes</title>
    <link>https://www.hascode.com/tags/db/</link>
    <description>Recent content in Db on Micha Kops&#39; Tech Notes</description>
    <generator>Hugo -- 0.147.8</generator>
    <language>en</language>
    <copyright>Copyright © 2010 - 2025 Micha Kops. #213243b1d6e8932079e09227d3f3ed0c806cd0c9</copyright>
    <lastBuildDate>Wed, 30 Jan 2019 00:00:00 +0100</lastBuildDate>
    <atom:link href="https://www.hascode.com/tags/db/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Using Throwaway Containers for Integration Testing with Java, JUnit 5 and Testcontainers.</title>
      <link>https://www.hascode.com/using-throwaway-containers-for-integration-testing-with-java-junit-5-and-testcontainers./</link>
      <pubDate>Wed, 30 Jan 2019 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/using-throwaway-containers-for-integration-testing-with-java-junit-5-and-testcontainers./</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;A lot of boilerplate code is written when developers need to test their applications with different connected systems like databases, stream platforms and other collaborators.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Docker allows to handle those dependencies but there is still some glue code required to bind the container’s lifecycle and the configuration to the concrete integration test.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Testcontainers is a testing library that offers lightweight throwaway instances of anything able to run in a Docker container, with bindings to configure the specific containers and also provides wrappers to manage our own custom containers.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Using jetstreamDB as in-memory Database for Java</title>
      <link>https://www.hascode.com/using-jetstreamdb-as-in-memory-database-for-java/</link>
      <pubDate>Sat, 30 Jun 2018 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/using-jetstreamdb-as-in-memory-database-for-java/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;JetstreamDB is a in-memory database engine for Java that claims to be built for ultra-high speed and the ability of managing complex data structures by storing real Java objects instead of serializing data structures to other database specific formats.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following short example I would like to demonstrate how to create and read items from such a database by building a small article management sample app.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;imageblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;img src=&#34;jetstreamdb-intellij.png&#34; alt=&#34;Using jetstreamDB for Java&#34; width=&#34;520&#34; height=&#34;345&#34;/&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Creating and Providing HipChat Integrations with Atlassian Connect, Nodejs and Express</title>
      <link>https://www.hascode.com/creating-and-providing-hipchat-integrations-with-atlassian-connect-nodejs-and-express/</link>
      <pubDate>Tue, 18 Aug 2015 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/creating-and-providing-hipchat-integrations-with-atlassian-connect-nodejs-and-express/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;HipChat is Atlassian’s alternative to Slack and its solution to team collaboration chats. Atlassian Connect offers developer tools to bootstrap applications, connect to Atlassian’s cloud products with easy and in combination with HipChat’s REST APIs allows us to write integrations for such a chat server in no time.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following tutorial I’d like to show how to write an integration within a few steps using Atlassian Connect, Node.js and Express and how to connect the integration to a HipChat server.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Java EE 7 Database Migrations with Liquibase and WildFly</title>
      <link>https://www.hascode.com/java-ee-7-database-migrations-with-liquibase-and-wildfly/</link>
      <pubDate>Thu, 31 Jul 2014 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/java-ee-7-database-migrations-with-liquibase-and-wildfly/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;I have written about other database migration frameworks before but in this article I’d like to cover the Liquibase framework in combination with WildFly as Java EE 7 compatible application server.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following tutorial, we’re going to write a full Java EE 7 book store application with a few steps and with Liquibase on board to create the database structure and insert example data into the database.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Thanks to the WildFly Maven Plug-in we even do not need to download and configure the application server but let Maven and the plug-in do the work for us.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Easy Database Migrations using Flyway, Java EE 6 and GlassFish</title>
      <link>https://www.hascode.com/easy-database-migrations-using-flyway-java-ee-6-and-glassfish/</link>
      <pubDate>Sun, 28 Apr 2013 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/easy-database-migrations-using-flyway-java-ee-6-and-glassfish/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Database migrations often are a necessity in the application development and maintenance life-cycle.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Whenever we need to apply changes to the database structure, insert new data fragments and in doing so want to be sure that this all happens with some control and versioning.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;The following tutorial shows how implement this for a simple Java EE 6 web application to be run on a GlassFish application server in a few quick steps using the Flyway framework, an eager initialized Singleton EJB and some Maven wiring.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Postgres Snippets</title>
      <link>https://www.hascode.com/postgres-snippets/</link>
      <pubDate>Mon, 01 Mar 2010 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/postgres-snippets/</guid>
      <description>&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_get_size_of_a_table&#34;&gt;Get size of a table&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;SELECT pg_size_pretty(pg_total_relation_size(&amp;#39;schemaname.tablename&amp;#39;));&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_select_unique_combination_of_fields_tuples&#34;&gt;Select unique combination of fields / tuples&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;SELECT DISTINCT ON(field1, field2) field1, field2
FROM thetable&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_select_rows_where_a_combination_of_fields_is_not_unique&#34;&gt;Select rows where a combination of fields is not unique&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;SELECT columnA, columnB, count(*) AS count
FROM thetable
GROUP BY columnA, columnB
HAVING count(*) &amp;gt; 1&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_search_for_rows_with_array_containing_value&#34;&gt;Search for rows with array containing value&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Assuming, the field &lt;code&gt;appointments&lt;/code&gt; has the type &lt;code&gt;date[]&lt;/code&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;SELECT *
FROM mtable
WHERE appointments @&amp;gt; ARRAY[&amp;#39;2023-09-19&amp;#39;::date]&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
