<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Springboot on JOURNAL.ROBBI.MY</title><link>https://journal.robbi.my/tags/springboot/</link><description>Recent content in Springboot on JOURNAL.ROBBI.MY</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 30 Jun 2026 03:01:59 +0000</lastBuildDate><atom:link href="https://journal.robbi.my/tags/springboot/index.xml" rel="self" type="application/rss+xml"/><item><title>bookmark - Scaling Spring Boot Strategies for Handling Millions of Requests</title><link>https://journal.robbi.my/indieweb/241103110133/</link><pubDate>Sun, 03 Nov 2024 11:01:33 +0800</pubDate><guid>https://journal.robbi.my/indieweb/241103110133/</guid><description>&lt;p&gt;Mirror:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://archive.ph/HTgEv"&gt;archive.today&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Bookmark : Java Task Executor in Spring Boot</title><link>https://journal.robbi.my/indieweb/241103092119/</link><pubDate>Sun, 03 Nov 2024 09:21:19 +0800</pubDate><guid>https://journal.robbi.my/indieweb/241103092119/</guid><description>&lt;p&gt;Mirror:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://archive.ph/AfLKw#selection-3629.248-3629.256"&gt;archive.today&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>[PART 2] Spring Boot - Multiple datasource (database) with JDBC and JPA</title><link>https://journal.robbi.my/posts/241102093844/</link><pubDate>Sat, 02 Nov 2024 09:38:44 +0800</pubDate><guid>https://journal.robbi.my/posts/241102093844/</guid><description>&lt;p&gt;We start with &lt;code&gt;postgreSQL&lt;/code&gt; because this our primary database connection and we do all CRUD stuff from here. We need 2 class, which use for connection and configuration of datasource.&lt;/p&gt;
&lt;h3 id="datasourceconfigurationpostgresql"&gt;DatasourceConfigurationPostgreSQL&lt;/h3&gt;
&lt;div class="code-block"&gt;
 &lt;div class="code-header font-mono"&gt;
 &lt;span class="code-lang"&gt;java&lt;/span&gt;
 &lt;div class="code-window-controls"&gt;
 &lt;button class="code-copy" onclick="copyCode(this)" title="Copy to clipboard"&gt;📋 Copy&lt;/button&gt;
 &lt;span class="ctrl-min"&gt;&lt;/span&gt;
 &lt;span class="ctrl-max"&gt;&lt;/span&gt;
 &lt;span class="ctrl-close"&gt;&lt;/span&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;div class="code-content"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;package&lt;/span&gt; com.robbi.demo.config.postgresql;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;import&lt;/span&gt; javax.sql.DataSource;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;import&lt;/span&gt; org.slf4j.Logger;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;import&lt;/span&gt; org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;import&lt;/span&gt; org.springframework.boot.context.properties.ConfigurationProperties;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;import&lt;/span&gt; org.springframework.context.annotation.Bean;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;import&lt;/span&gt; org.springframework.context.annotation.Configuration;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;import&lt;/span&gt; org.springframework.context.annotation.Primary;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;import&lt;/span&gt; com.robbi.demo.utils.LoggerFactoryUtil;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;@Configuration
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#8be9fd;font-style:italic"&gt;public&lt;/span&gt; &lt;span style="color:#8be9fd;font-style:italic"&gt;class&lt;/span&gt; &lt;span style="color:#50fa7b"&gt;DatasourceConfigurationPostgreSQL&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	&lt;span style="color:#8be9fd;font-style:italic"&gt;private&lt;/span&gt; &lt;span style="color:#8be9fd;font-style:italic"&gt;static&lt;/span&gt; &lt;span style="color:#8be9fd;font-style:italic"&gt;final&lt;/span&gt; Logger LOG &lt;span style="color:#ff79c6"&gt;=&lt;/span&gt; LoggerFactoryUtil.&lt;span style="color:#50fa7b"&gt;getLogger&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; @Bean
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; @ConfigurationProperties(&lt;span style="color:#f1fa8c"&gt;&amp;#34;spring.datasource.postgresql&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#8be9fd;font-style:italic"&gt;public&lt;/span&gt; DataSourceProperties &lt;span style="color:#50fa7b"&gt;dataSourcePropertiesPostgreSQL&lt;/span&gt;() {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;		LOG.&lt;span style="color:#50fa7b"&gt;info&lt;/span&gt;(&lt;span style="color:#f1fa8c"&gt;&amp;#34;spring.datasource.postgresql&amp;#34;&lt;/span&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#ff79c6"&gt;return&lt;/span&gt; &lt;span style="color:#ff79c6"&gt;new&lt;/span&gt; DataSourceProperties();
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; @Bean
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; @Primary
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#8be9fd;font-style:italic"&gt;public&lt;/span&gt; DataSource &lt;span style="color:#50fa7b"&gt;dataSourcePostgreSQL&lt;/span&gt;() {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;		LOG.&lt;span style="color:#50fa7b"&gt;info&lt;/span&gt;(&lt;span style="color:#f1fa8c"&gt;&amp;#34;Initializing PostgreSQL DataSource: {}&amp;#34;&lt;/span&gt;, dataSourcePropertiesPostgreSQL().&lt;span style="color:#50fa7b"&gt;getUrl&lt;/span&gt;());
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	 &lt;span style="color:#ff79c6"&gt;return&lt;/span&gt; dataSourcePropertiesPostgreSQL()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	 .&lt;span style="color:#50fa7b"&gt;initializeDataSourceBuilder&lt;/span&gt;()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	 .&lt;span style="color:#50fa7b"&gt;build&lt;/span&gt;();
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Take note on anotation &lt;code&gt;@ConfigurationProperties&lt;/code&gt; and &lt;code&gt;@Primary&lt;/code&gt; that I applied here.&lt;/p&gt;</description></item><item><title>[PART 1] Spring Boot - Multiple datasource (database) with JDBC and JPA</title><link>https://journal.robbi.my/posts/240929095904/</link><pubDate>Sun, 29 Sep 2024 09:59:04 +0800</pubDate><guid>https://journal.robbi.my/posts/240929095904/</guid><description>&lt;p&gt;Assalamualaikum and hello! Spring Boot&amp;rsquo;s streamlined development process makes it a popular choice for many developers.
However, configuring it for multiple databases can present challenges.
While there are various tutorials available, I&amp;rsquo;ve encountered issues with their completeness and clarity.
In this tutorial, I&amp;rsquo;ll provide a detailed solution to this problem.&lt;/p&gt;
&lt;h2 id="database"&gt;Database&lt;/h2&gt;
&lt;p&gt;We require a connection to two databases: an existing MSSQL database and a new PostgreSQL database.
The PostgreSQL database will be used for all standard CRUD operations (create, read, update, delete).
The MSSQL database will be accessed in a read-only manner to retrieve specific data without making any modifications to its structure or content.&lt;/p&gt;</description></item><item><title>24 01 24 1304_springboot Maven Update Dependencies</title><link>https://journal.robbi.my/indieweb/240124010447/</link><pubDate>Wed, 24 Jan 2024 13:04:47 +0800</pubDate><guid>https://journal.robbi.my/indieweb/240124010447/</guid><description>&lt;p&gt;Awesome tutorial written by Bunty Raghani from &lt;a href="https://bootcamptoprod.com"&gt;bootcamptoprod.com&lt;/a&gt; about update maven dependencies effortlessly and keep springboot project up-to-date&lt;/p&gt;
&lt;p&gt;Mirror:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://archive.ph/RfyWM"&gt;archive.today&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web.archive.org/web/20240124050414/https://bootcamptoprod.com/update-maven-dependencies/"&gt;Wayback Machine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>23 10 24 0912_springboot Beginner Step</title><link>https://journal.robbi.my/indieweb/231024091253/</link><pubDate>Tue, 24 Oct 2023 09:12:53 +0800</pubDate><guid>https://journal.robbi.my/indieweb/231024091253/</guid><description/></item><item><title>23 10 24 0850_JPA QueryDSL</title><link>https://journal.robbi.my/indieweb/231024085007/</link><pubDate>Tue, 24 Oct 2023 08:50:07 +0800</pubDate><guid>https://journal.robbi.my/indieweb/231024085007/</guid><description/></item><item><title>23 09 28 0436_springboot2 vs Springboot3</title><link>https://journal.robbi.my/indieweb/230928043606/</link><pubDate>Thu, 28 Sep 2023 04:36:06 +0800</pubDate><guid>https://journal.robbi.my/indieweb/230928043606/</guid><description>&lt;p&gt;Mirror:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://archive.ph/T7VP7"&gt;Archive.PH&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>23 09 28 0255_bookmark Springboot Json Jackson</title><link>https://journal.robbi.my/indieweb/230928025535/</link><pubDate>Thu, 28 Sep 2023 02:55:35 +0800</pubDate><guid>https://journal.robbi.my/indieweb/230928025535/</guid><description>&lt;p&gt;Mirror :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://web.archive.org/web/20230205150038/https://www.springcloud.io/post/2022-07/jackson/#gsc.tab=0"&gt;WayBackMachine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://archive.ph/IqvdT"&gt;Archive.ph&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>23 09 25 0000_bookmark Springboot Retry</title><link>https://journal.robbi.my/indieweb/230925120029/</link><pubDate>Mon, 25 Sep 2023 00:00:29 +0800</pubDate><guid>https://journal.robbi.my/indieweb/230925120029/</guid><description/></item><item><title>23 09 20 1611_bookmark Springboot Quick Start</title><link>https://journal.robbi.my/indieweb/230920041204/</link><pubDate>Wed, 20 Sep 2023 16:12:04 +0800</pubDate><guid>https://journal.robbi.my/indieweb/230920041204/</guid><description>&lt;p&gt;Mirror:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://web.archive.org/web/20230920081054/https://www.springcloud.io/post/2022-09/springboot-getstart/#gsc.tab=0"&gt;WaybackMachine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>23 09 20 1158_bookmark Springboot Unit Test</title><link>https://journal.robbi.my/indieweb/230920115915/</link><pubDate>Wed, 20 Sep 2023 11:59:15 +0800</pubDate><guid>https://journal.robbi.my/indieweb/230920115915/</guid><description>&lt;p&gt;Mirror:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://web.archive.org/web/20230920034320/https://www.springcloud.io/post/2023-05/spring-boot-unit-test/#gsc.tab=0"&gt;WaybackMachine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>23 09 20 1132_bookmark Springboot Resources Autowired</title><link>https://journal.robbi.my/indieweb/230920113221/</link><pubDate>Wed, 20 Sep 2023 11:32:21 +0800</pubDate><guid>https://journal.robbi.my/indieweb/230920113221/</guid><description>&lt;p&gt;Mirror :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://web.archive.org/web/20230920033111/https://www.springcloud.io/post/2023-06/spring-autowired-and-resource/#gsc.tab=0"&gt;WaybackMachine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>23 09 20 1102_bookmark Springboot File Download</title><link>https://journal.robbi.my/indieweb/230920110305/</link><pubDate>Wed, 20 Sep 2023 11:03:05 +0800</pubDate><guid>https://journal.robbi.my/indieweb/230920110305/</guid><description>&lt;p&gt;Mirror:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://web.archive.org/web/20230920030413/https://www.springcloud.io/post/2023-03/springboot-download/#gsc.tab=0"&gt;WaybackMachine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>One To Many - Many To One (JPA and Hibernate)</title><link>https://journal.robbi.my/posts/210607120000/</link><pubDate>Mon, 07 Jun 2021 00:00:00 +0000</pubDate><guid>https://journal.robbi.my/posts/210607120000/</guid><description>&lt;nav id="TableOfContents"&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#intro"&gt;Intro&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#database-design"&gt;Database design&lt;/a&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#unidirectional-implementation"&gt;Unidirectional implementation&lt;/a&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#model"&gt;Model&lt;/a&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#table---customer"&gt;Table - Customer&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#table---cart"&gt;Table - Cart&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;&lt;a href="#details-and-explaination"&gt;Details and explaination&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;&lt;a href="#bidirectional-implementation"&gt;Bidirectional implementation&lt;/a&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#model-1"&gt;Model&lt;/a&gt;
 &lt;ul&gt;
 &lt;li&gt;&lt;a href="#table---customer-1"&gt;Table - Customer&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#table---order"&gt;Table - Order&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;&lt;a href="#details-and-explaination-1"&gt;Details and explaination&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#side-note"&gt;Side note&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/li&gt;
 &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;&lt;a href="#conclusion"&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
 &lt;/ul&gt;
&lt;/nav&gt;

&lt;h2 id="intro"&gt;Intro&lt;/h2&gt;
&lt;p&gt;Nowadays, programming evolve and growth rapidly from time to time but most of problem and issue that we want to solve have same design concept in many ways.&lt;/p&gt;
&lt;p&gt;Today, I want to wrote something about relational database system. The topic today are about &lt;code&gt;one-to-many&lt;/code&gt; / &lt;code&gt;many-to-one&lt;/code&gt; association relationship. It about a links of multiple tables based on a FK (Foreign Key) column which that the child table record references back to the PK (Primary Key) of the parent table row data. I also will touch &lt;code&gt;unidirectional&lt;/code&gt; and &lt;code&gt;bidirectional&lt;/code&gt; propagation.&lt;/p&gt;</description></item></channel></rss>