Year: 2015

At the heart of the Spring Framework is its support of dependency injection through its Inversion of Control container. In this video, I look at using some of the advanced autowire features of Spring. @Primary By default, Spring will autowire by type. When you have more than one Spring Bean of a given type, you can […]Continue reading

As a Java programmer, you will often need to work with date and time. In this post, we will learn how to get the current time of the day in Java applications. In Java, there are several ways for this and the primary classes that programmers typically use are the Date and Calendar classes. You can use both […]Continue reading

Often when using Spring for enterprise application development, while developing code on your laptop, you will want to run against a in memory H2 database, and later you will deploy the code to a server and have it run against enterprise database such as Oracle. While Oracle is the #1 RDBMS used in the enterprise, it’s […]Continue reading

When you start with Spring Boot, it will automatically support H2 if no other data sources have been defined and H2 is found on the classpath. I’ve been using H2 for development for sometime now. It works very well.  All modern relational databases are going to support ANSI SQL. But each is going to have […]Continue reading

Out of the box, Spring Boot is very easy to use with the H2 Database. If the H2 database is found on your classpath, Spring Boot will automatically set up an in-memory H2 database for your use. But what if you want to use MySQL? Naturally, Spring Boot has support for MySQL and a number […]Continue reading

Unit tests should be small tests (atomic), lightweight, and fast. However, an object under test might have dependencies on other objects. It might need to interact with a database, communicate with a mail server, or talk to a web service or a message queue. All these services might not be available during unit testing. Even […]Continue reading

I was recently asked on my Facebook page, “How do I become a Java Web Developer?” There is  really no simple answer for this question. There are many facets to becoming a Java web developer. I’ve encountered Java developers who were good front end developers, or good backend developers. By ‘front end’, I mean more of […]Continue reading