Contents
  1. 1. Java
  2. 2. Data Access
  3. 3. Spring Framework

Java

1. Use logging. Never use system.out.print().

For long-running programs, you’ll need to look at the log files to check that the program is functioning correctly.

2. For the scheduled task thread or any thread other than the main thread, catch the entire code block exception.

Generally, the main thread has global exception handling, but other threads do not.

3. No empty catch blocks.

An empty catch block won’t give you any information about what exception occurred. Probably the exception doesn’t matter, but it’s still an exceptional case.

Data Access

1. Never execute SQL statements in a for loop.

It takes a lot of time. You should find a way to do it in bulk.

Spring Framework

1. Scheduling tasks should run when a specific profile is activated.

Contents
  1. 1. Java
  2. 2. Data Access
  3. 3. Spring Framework