28 May 2020

feedDZone Java Zone

How to Update the Record in the Database Using JdbcTemplate With Spring Boot

In the video below, we take a closer look at how to update the record in the database using JdbcTemplate with Spring Boot. Let's get started!

28 May 2020 6:20pm GMT

Bridge the Gap of Zip Operation

Despite Java not providing a zip operation, you don't need either 30 additional lines to implement it, nor a third party library. Simply compose a zipline through the existing Stream API.

Abstract

Java, from its 8th version onward, provides an easy way to query sequences of elements through its Stream Interface, which provides several operations out of the box. This set of operations is quite versatile but, as can be expected, it does not cover all the operations a programmer may require. One such operation is zip, as we can observe in one of the most visited posts about Java Streams in Stackoverfow: Zipping streams using JDK8 with lambda (java.util.stream.Streams.zip). Even 7 years later, we are now on Java 14 release and there is no zip operation for Streams yet.

28 May 2020 2:19pm GMT

Choosing the Best Garbage Collection Algorithm for Better Performance in Java

In this article, I'm going to explain how Garbage Collection works behind the scene to free up memory. Java memory management has emerged a lot over the past few Java releases. Understanding the different GC algorithms will help you better to tune it (if required) depending upon the different performance issues we see in many of the Java-based application performance testing. When your Java application runs, it creates objects which take up memory space. As long as the object is being used (i.e referred by the application somewhere), it is going to occupy the memory. When the object is no longer used (for example, when you cleanly close a DB connection), the space occupied by the object can be reclaimed by Garbage collection.

How to choose the best garbage collector for your use case for any Java-based application performance testing? Before we go into that question lets talk some of the below basic concepts.

28 May 2020 2:25am GMT

26 May 2020

feedDZone Java Zone

Secure Your Method Using AOP

In this article we learn how to secure our methods the easy way!

We basically use the Before Advice of aspect-oriented programming (AOP) to achieve our goal. The article even illustrates how easy it is to use AOP to implement a crosscutting concern such as security. Let's get started

26 May 2020 9:42pm GMT

Vincer-Dom and Modern XML/DOM Manipulation

Writing or editing DOM-XML in Java (or another language) has never been natural or straightforward. The code structure diverges inexorably from the underlying tree structure it manipulates, obscuring the original intentions.

Vincer-Dom fixes this issue by using Parent-Chaining Pattern to offer a powerful fresh new style API.

26 May 2020 8:27pm GMT

Using JdbcTemplate With Spring Boot and Thymeleaf | Spring Boot Tutorial

In the video below, we take a closer look at Using JdbcTemplate with Spring Boot and Thymeleaf. Let's get started!

26 May 2020 4:39pm GMT

Configure DataSource Using JNDI Using Tomcat 9 Server: Spring Boot Tutorial

In the video below, we take a closer look at SpringBoot Configure DataSource Using JNDI with Example using Tomcat 9 Server. Let's get started!

26 May 2020 4:33pm GMT

10 Coding Principles Every Programmer Should Learn

The Object-Oriented Design Principles are the core of OOP programming. Still, I have seen most of the Java programmers chasing design patterns like Singleton pattern, Decorator pattern, or Observer pattern, and not putting enough attention on learning Object-oriented analysis and design.

It's essential to learn the basics of Object-oriented programming like Abstraction, Encapsulation, Polymorphism, and Inheritance. But, at the same time, it's equally important to know object-oriented design principles.

26 May 2020 11:21am GMT

Java 11 HTTP Client API to Consume Restful Web Service Created Using Spring Boot

One of the features added in Java 11 is the standardized Http Client API. This article describes how to use Java 11 Http Client API to send HTTP GET/POST/PUT/DELETE requests.

This new API supports HTTP / 1.1 as well as HTTP 2. The newer version of the HTTP protocol is designed to improve the overall performance of sending requests by a client and receiving responses from the server. This is achieved by introducing several changes such as stream multiplexing, header compression and push promises.

26 May 2020 10:47am GMT

23 May 2020

feedDZone Java Zone

Writing Functional Interfaces in Java

In this article, we will highlight the purpose and usability of a functional interface in comparison with several alternatives. We will look at how to evolve the code from its basic and rigid implementation to a flexible implementation based on a functional interface. For this, let's consider the following Melon class:

Java




x
12


1
public class Melon {
2
  
3
  private final String type;  
4
  private final int weight;
5
  private final String origin;
6
 
7
  public Melon(String type, int weight, String origin) {
8
    this.type = type;
9
    this.weight = weight;
10
    this.origin = origin;
11
  }
12
  
13
  // getters, toString(), and so on omitted for brevity
14
}



23 May 2020 1:24am GMT

22 May 2020

feedDZone Java Zone

Databricks Delta Lake Using Java

Delta Lake is an open source release by Databricks that provides a transactional storage layer on top of data lakes. In real-time systems, a data lake can be an Amazon S3, Azure Data Lake Store/Azure Blob storage, Google Cloud Storage, or Hadoop Distributed file system.

Delta Lake acts as a storage layer that sits on top of Data Lake. Delta Lake brings additional features where Data Lake cannot provide.

22 May 2020 6:21pm GMT

Creating Daemon Thread in Java

In this tutorial, you will learn how to create Daemon Thread in Java.

What is Daemon Thread in Java?

The Java runtime environment takes advantage of a special type of thread for background tasks. It's called a daemon thread, where the daemon is pronounced "demon." These support threads manage behind-the-screen tasks like garbage collection.

22 May 2020 6:13pm GMT

Generating Classes at Runtime and Invoking Their Methods With and Without the Use of Reflection in Java 8 and Later

The generation of classes at runtime is an advanced topic that requires a lot of knowledge that can be reduced if you use particular libraries that perform the most complex functions to accomplish this task.
So, for this purpose, we can use the ClassFactory component and the sources generating components of the Burningwave Core library. Once the sources have been set in UnitSourceGenerator objects, they must be passed to loadOrBuildAndDefine method of ClassFactory with the ClassLoader where you want to define newly generated classes.

This method performs the following operations: tries to load all the classes present in the UnitSourceGenerator through the class loader, if at least one of these is not found it proceeds to compile all the UnitSourceGenerators and uploading their classes on class loader: in this case, keep in mind that if a class with the same name was previously loaded by the class loader, the compiled class will not be uploaded.

22 May 2020 6:10pm GMT

21 May 2020

feedDZone Java Zone

The Most Unique/Fun Programming Languages That Have Ever Existed

There's been a lot of languages like the new-age love Python and R or the old school bestie, Java. Although programming languages are designed to make complex problems easier. Every programming language has its own pros and cons but some languages are built for another reason - sheer fun!

Usability is not the goal for these languages nor they find their roots in academia. They are above all programming paradigms but still maintain their reputation of being a Turing Complete language - well some of them.

21 May 2020 9:00pm GMT

DDD and Spring Boot Multi-Module Maven Project

In this post we will go through how to create a Multi-Module Maven Project with Spring Boot following Domain-Driven Methodology.

Here I must confess that I am not being a total DDD purist here adhering to all the concepts but instead just covering the first mile. With this in your arsenal you should be in a position to extend this as per your project needs.

21 May 2020 8:07pm GMT

SonarQube - Static Tool to Analyse and Inspect Code Quality

There are many tools in the testing world to find out bugs and analyze the code after running or execution of the program. Such tools are called dynamic testing tool. There are only few static testing tools that analyze code and give us reports without any execution. We are going to see about one such tool called SonarQube here. Let's see what is it and how to do code inspection in a maven project.

SonarQube

It is an open-source tool used for continuous inspection of code quality. It helps in finding out bugs, code smells, code coverage, and security vulnerabilities. It provides detailed reports on coding standards, unit tests, code coverage, bugs, and security vulnerabilities.

21 May 2020 7:56pm GMT

10 Nov 2011

feedPlanetJava

OSDir.com - Java: Red Hat's top secret Java Killer/Successor: The Ceylon Project

From the Ceylon dept.:

Gavin King of Red Hat/Hibernate/Seam fame recently unveiled the top secret project that he has been working on over the past two years, a new language and SDK designed to replace Java in the enterprise. The project came out of hiding without much fanfare or publicity at QCon Beijing in a keynote titled "The Ceylon Project - the next generation of Java language?".

10 Nov 2011 6:01am GMT

OSDir.com - Java: Oracle Introduces New Java Specification Requests to Evolve Java Community Process

From the Yet Another dept.:

To further its commitment to the Java Community Process (JCP), Oracle has submitted the first of two Java Specification Requests (JSRs) to update and revitalize the JCP.

10 Nov 2011 6:01am GMT

OSDir.com - Java: No copied Java code or weapons of mass destruction found in Android

From the Fact Checking dept.:

ZDNET: Sometimes the sheer wrongness of what is posted on the web leaves us speechless. Especially when it's picked up and repeated as gospel by otherwise reputable sites like Engadget. "Google copied Oracle's Java code, pasted in a new license, and shipped it," they reported this morning.



Sorry, but that just isn't true.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Java SE 7 Released

From the Grande dept.:

Oracle today announced the availability of Java Platform, Standard Edition 7 (Java SE 7), the first release of the Java platform under Oracle stewardship.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Java SE 7 Passes JCP

From the Jitters dept.:

The next edition of Java has been approved by a Java Community Process executive committee, but not without some acrimony.

10 Nov 2011 6:01am GMT

OSDir.com - Java: JDK 7 RC1 Released

From the JDK dept.:

After an initial round of testing we've declared build 147 to be the first Release Candidate of JDK 7.



There are only thirteen changes in this build. Over half of them are administrivial updates that don't affect the actual code; the remainder are true showstoppers, including several hard VM crashes and a JIT correctness bug identified by an Eclipse unit test.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Google Files Sizzling Answer to Oracle's Amended Java Complaint

From the Counter dept.:

Google has filed its answer to Oracle's amended complaint and its memorandum opposing Oracle's Motion to Dismiss. And we find out why Google didn't just roll over and pay Oracle for a license. Oracle asked in its motion to dismiss that the counterclaims alleging that Oracle's patents are invalid be dismissed. So Google explains more thoroughly why it believes they are in fact invalid. First, Google asserts:



Each of the Patents-in-Suit is invalid under 35 U.S.C. ยง 101 because one or more claims are directed to abstract ideas or other non-statutory subject matter.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache loses Java showdown vote to Oracle

From the Dis Harmony dept.:

The Apache Software Foundation - one of tech's most influential open-source groups - is closer to quitting Java's governing body after losing a stand-off vote against Oracle on Java.



The Reg has learned that with 75 per cent of qualifying Java Community Process (JCP) members having voted on whether to ratify Oracle's proposed roadmap for Java 7 and 8, Oracle's plan has been accepted.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache Software Foundation Resigns from Java Community Process

From the So Long dept.:

The Apache Software Foundation has resigned its seat on the Java SE/EE Executive Committee. Apache has served on the EC for the past 10 years, winning the JCP "Member of the Year" award 4 times, and recently was ratified for another term with support from 95% of the voting community. Further, the project communities of the ASF, home to Apache Tomcat, Ant, Xerces, Geronimo, Velocity and nearly a 100 mainstay java components have implemented countless JSRs and serve on and contribute to many of the JCPs technical expert groups.



We'd like to provide some explanation to the community as to why we're taking this significant step.



The recent Java SE 7 vote was the last chance for the JCP EC to demonstrate that the EC has any intent to defend the JCP as an open specification process, and demonstrate that the letter and spirit of the law matter. To sum up the issues at stake in the vote, we believe that while continuing to fail to uphold their responsibilities under the JSPA, Oracle provided the EC with a Java SE 7 specification request and license that are self-contradictory, severely restrict distribution of independent implementations of the spec, and most importantly, prohibit the distribution of independent open source implementations of the spec. Oracle has refused to answer any reasonable and responsible questions from the EC regarding these problems.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache Discontinues Independent Java Implementation 'Harmony'

From the DisHarmony dept.:

After the resignation of Apache from the Java SE/EE Executive Committee, the time has now come for Harmony to be added to the Apache Attic. Harmony was 'the project to produce an open source cleanroom implementation of Java.' An open vote was taken within the Project Management Committee, which resulted in a 20-2 majority to discontinue development.

10 Nov 2011 6:01am GMT

Javable: YourKit Java Profiler 7.0 released

The major update to YourKit Java Profiler has been released. Version 7.0 includes

10 Nov 2011 6:01am GMT

Javable: Sun phases out mobile Java

Sun will gradually phase out mobile Java (Java Micro Edition) and move respective services to Standard Edition. "We're trying to converge

10 Nov 2011 6:01am GMT

Javable: Google Android SDK is available

The development kit and API for Google mobile platform, Android, has been released.

10 Nov 2011 6:01am GMT

Javable: Consumer JRE Early Access

Sun has started an early access program to Java SE 6 Update N (formerly known as the "Consumer

10 Nov 2011 6:01am GMT

Javable: NetBeans 6.0 released

New version of pure Java IDE has been released, with support for many new

10 Nov 2011 6:01am GMT

Javable: Happy New Year!

We wish a Happy New Year to all our readers and contributers. Hope to see you all in 2008.

10 Nov 2011 6:01am GMT