DbSchema is a super-flexible database designer, which can take you from designing the DB with your team all the way to safely deploying the schema .
The way it does all of that is by using a design model , a database-independent image of the schema, which can be shared in a team using GIT and compared or deployed on to any database.
And, of course, it can be heavily visual, allowing you to interact with the database using diagrams, visually compose queries, explore the data, generate random data, import data or build HTML5 database reports.
Take a look at DBSchema
Azure Spring Apps is a fully managed service from Microsoft (built in collaboration with VMware), focused on building and deploying Spring Boot applications on Azure Cloud without worrying about Kubernetes.
The Enterprise plan comes with some interesting features, such as commercial Spring runtime support, a 99.95% SLA and some deep discounts (up to 47%) when you are ready for production.
>> Learn more and deploy your first Spring Boot app to Azure.
And, you can participate in a very quick (1 minute) paid user research from the Java on Azure product team.
Slow MySQL query performance is all too common. Of course it is. A good way to go is, naturally, a dedicated profiler that actually understands the ins and outs of MySQL.
The Jet Profiler was built for MySQL only , so it can do things like real-time query performance, focus on most used tables or most frequent queries, quickly identify performance issues and basically help you optimize your queries.
Critically, it has very minimal impact on your server's performance, with most of the profiling work done separately - so it needs no server changes, agents or separate services.
Basically, you install the desktop application, connect to your MySQL server , hit the record button, and you'll have results within minutes:
out the Profiler
A quick guide to materially improve your tests with Junit 5:
>> The Junit 5 handbookDo JSON right with Jackson
Get the most out of the Apache HTTP Client
Get Started with Apache Maven:
Working on getting your persistence layer right with Spring?
Building a REST API with Spring?
Explore Spring Boot 3 and Spring 6 in-depth through building a full REST API with the framework:
REST With Spring (new)
Get started with Spring and Spring Boot, through the reference Learn Spring course:
The AI Assistant to boost Boost your productivity writing unit tests - Machinet AI .
AI is all the rage these days, but for very good reason. The
highly practical coding companion, you'll get the power of
AI-assisted coding and
automated unit test generation
.
Machinet's
Unit Test AI Agent
utilizes your own project
context to create meaningful unit tests that intelligently aligns
with the behavior of the code.
And, the
AI Chat
crafts code and fixes errors with ease,
like a helpful sidekick.
Simplify Your Coding Journey with Machinet AI :
Get non-trivial analysis (and trivial, too!) suggested right inside your IDE or Git platform so you can code smart, create more value, and stay confident when you push.
Get CodiumAI for free and become part of a community of over 280,000 developers who are already experiencing improved and quicker coding.
Write code that works the way you meant it to:
CodiumAI. Meaningful Code Tests for Busy Devs
Looking for the ideal Linux distro for running modern Spring apps in the cloud?
Meet Alpaquita Linux : lightweight, secure, and powerful enough to handle heavy workloads.
This distro is specifically designed for running Java apps . It builds upon Alpine and features significant enhancements to excel in high-density container environments while meeting enterprise-grade security standards.
Specifically, the container image size is ~30% smaller than standard options, and it consumes up to 30% less RAM:
Alpaquita Containers now.
Yes, Spring Security can be complex, from the more advanced functionality within the Core to the deep OAuth support in the framework.
I built the security material as two full courses - Core and OAuth , to get practical with these more complex scenarios. We explore when and how to use each feature and code through it on the backing project .
You can explore the course here:
DbSchema is a super-flexible database designer, which can take you from designing the DB with your team all the way to safely deploying the schema .
The way it does all of that is by using a design model , a database-independent image of the schema, which can be shared in a team using GIT and compared or deployed on to any database.
And, of course, it can be heavily visual, allowing you to interact with the database using diagrams, visually compose queries, explore the data, generate random data, import data or build HTML5 database reports.
Take a look at DBSchema
Slow MySQL query performance is all too common. Of course it is. A good way to go is, naturally, a dedicated profiler that actually understands the ins and outs of MySQL.
The Jet Profiler was built for MySQL only , so it can do things like real-time query performance, focus on most used tables or most frequent queries, quickly identify performance issues and basically help you optimize your queries.
Critically, it has very minimal impact on your server's performance, with most of the profiling work done separately - so it needs no server changes, agents or separate services.
Basically, you install the desktop application, connect to your MySQL server , hit the record button, and you'll have results within minutes:
out the Profiler
Spring Data JPA is a great way to handle the complexity of JPA with the powerful simplicity of Spring Boot .
Get started with Spring Data JPA through the guided reference course:
Get started with Spring Boot and with core Spring, through the Learn Spring course:
1. Overview
When we want to build a string in Java, we usually choose the convenient StringBuilder to do the job.
Suppose we have a StringBuilder sequence containing some string segments and we want to remove the last character from it. In this quick tutorial, we’ll explore three ways to do this.
2. Using StringBuilder ‘s deleteCharAt() Method
The StringBuilder class has the deleteCharAt() method. It allows us to remove the character at the desired position .
The deleteCharAt() method has only one argument: the char index we want to delete.
Therefore, if we pass the last character’s index to the method, we can remove the character. For simplicity, we’ll use unit test assertions to verify it works as expected.
So next, let’s create a test to check if it works:
StringBuilder sb = new StringBuilder("Using the sb.deleteCharAt() method!");
sb.deleteCharAt(sb.length() - 1);
assertEquals("Using the sb.deleteCharAt() method", sb.toString());
As the test above shows, we pass the last character’s index (sb.length() -1 ) to the deleteCharAt() method, and expect the ending exclamation mark (!) to be removed.
If we run the test, it passes. So, deleteCharAt() solves the problem.
3. Using StringBuilder‘s replace() Method
StringBuilder‘s replace() method allows us to replace characters in a substring of the sequence with the given string. The method accepts three parameters:
start index – the beginning index, inclusive
end index – the ending index, exclusive
replacement – the string used to replace
Let’s say the last character’s index in the sequence is lastIdx. If we want to remove the last character, we can pass lastIdx as the start index, lastIdx+1 as the end index, and an empty string “” as the replacement to replace():
StringBuilder sb = new StringBuilder("Using the sb.replace() method!");
int last = sb.length() - 1;
sb.replace(last, last + 1, "");
assertEquals("Using the sb.replace() method", sb.toString());
Now, the test above passes if we give it a run. So, the replace() method can be used to solve the problem.
4. Using StringBuilder‘s substring() Method
We can use StringBuilder‘s substring() method to get a subsequence from the given start and end indexes of the string. The method requires two arguments, the beginning index (inclusive) and the ending index (exclusive).
It’s worth mentioning that the substring() method returns a new String object. In other words, the substring() method doesn’t modify the StringBuilder object.
We can pass 0 as the start index and the last character’s index as the end index to the substring() method to get a string with the last character chopped off:
StringBuilder sb = new StringBuilder("Using the sb.substring() method!");
assertEquals("Using the sb.substring() method", sb.substring(0, sb.length() - 1));
//the stringBuilder object is not changed
assertEquals("Using the sb.substring() method!", sb.toString());
The test passes if we execute it.
As we can see in the test, even though the String returned by the substring() is without the last character (!), the original StringBuilder isn’t changed.
5. Conclusion
In this brief article, we’ve learned how to remove the last character from a StringBuilder sequence.
As usual, all code snippets presented here are available over on GitHub.
Partner – Bellsoft – NPI EA (cat = Spring)
Just published a new writeup on how to run a standard Java/Boot
application as a Docker container, using the Liberica JDK on top of
Alpaquita Linux:
Spring Boot Application on Liberica Runtime Container.
Partner – Bellsoft – NPI EA (cat = Spring)
Looking for the ideal Linux distro for running modern Spring
apps in the cloud?
Meet Alpaquita Linux: lightweight, secure, and powerful
enough to handle heavy workloads.
This distro is specifically designed for running Java
apps. It builds upon Alpine and features significant
enhancements to excel in high-density container environments while
meeting enterprise-grade security standards.
Specifically, the container image size is ~30% smaller than
standard options, and it consumes up to 30% less RAM:
Alpaquita Containers now.
Partner – Aegik AB – NPI EA (tag = SQL)
Slow MySQL query performance is all too common. Of course
it is.
The Jet Profiler was built entirely for MySQL, so it's
fine-tuned for it and does advanced everything with relaly minimal
impact and no server changes.
out the Profiler
Partner – Codium – NPI EA (cat = Testing)
Explore the secure, reliable, and high-performance Test
Execution Cloud built for scale. Right in your IDE:
CodiumAI. Meaningful Code Tests for Busy Devs
Basically, write code that works the way you meant it to.
Partner – Machinet – NPI EA (cat = Testing)
AI is all the rage these days, but for very good reason. The
highly practical coding companion, you'll get the power of
AI-assisted coding and automated unit test generation.
Machinet's Unit Test AI Agent utilizes your own project
context to create meaningful unit tests that intelligently aligns
with the behavior of the code.
Simplify Your Coding Journey with Machinet AI:
Course – LS – All
Get started with Spring Boot and with core Spring,
through the Learn Spring course:
res – REST with Spring (eBook) (everywhere)
Learning to build your API
with Spring?
Download the E-book
Starting to test with Mockito?
Download the Guide
eBook – Video Security – NPI EA (cat=Spring Security)
Security basics for a REST API
access to the video
eBook – Persistence – NPI EA (cat=Persistence)