Functional Java by Example | Part 2 – Tell a Story

This is part 2 of the series called “Functional Java by Example”. The example I’m evolving in each part of the series is some kind of “feed handler” which processes documents. In previous part I started with some original code and applied some refactorings to describe “what” instead of “how”. In order to help the code going forward, we need ...

Read More »

Too Many PreparedStatement Placeholders in Oracle JDBC

java-interview-questions-answers

There are multiple causes of the ORA-01745 (“invalid host/bind variable name error”) error when using an Oracle database. The Oracle 9i documentation on errors ORA-01500 through ORA-02098 provides more details regarding ORA-01745. It states that the “Cause” is “A colon in a bind variable or INTO specification was followed by an inappropriate name, perhaps a reserved word.” It also states ...

Read More »

The Problem Solver

I’ll start this post with a quote:                     "Every great developer you know got there by solving problems they were unqualified to solve until they actually did it." – Patrick McKenzie — The Practical Dev (@ThePracticalDev) February 14, 2017 Good developers are good problem solvers. They turn each task into a ...

Read More »

A Tale of Two Iterators

When you look at the most popular Java interview questions, you might encounter the one about fail-fast and fail-safe iterators: What’s the difference between fail-fast and fail-safe iterators? The simplified answer is that: Fail-fast iterator throws ConcurrentModificationException if the collection is modified while iterating, but fail-safe doesn’t. Even though it totally makes sense, it’s not clear what the interviewer means ...

Read More »

[MEGA DEAL] Complete Java Programming Bootcamp (94% off)

10 Courses (83.5 Hours) to Become a Java Master: Design UIs with JavaFX, Utilize Design Patterns, Master Multithreading & More Hey fellow geeks, This week, on our JCG Deals store, we have another extreme offer. We are offering a massive 94% off on Complete Java Programming Bootcamp. Get it now with only $39, instead of the original price of $740. ...

Read More »

Configure passwords in Payara Server and GlassFish

java-interview-questions-answers

Answeriing Stackoverflow questions provides a great feedback for finding out gaps in the official documentation of my favourite opensource tools. One of the questions which I answered here was how to change Payara Server master password in docker container. Obviously, in a standard server installation, this is simple – just use the  asadmin change-master-password  command, then type the old and ...

Read More »

Java Optionals For More Expressive Code

Any of us who has programmed in a language that permits null references will have experienced what happens when you try to dereference one. Whether it results in a segfault or a NullPointerException, it’s always a bug. Tony Hoare described it as his billion-dollar mistake. The problem typically occurs when a function returns a null reference to a client that was ...

Read More »

Easily Return Values From a Transaction with Speedment 3.0.17 or Later

Transactions In my previous post, I wrote about how to use Transactions in an easy way using Speedment where we updated two bank accounts atomically. As you all might know, transactions are a way of combining a number of database operation into a single operation that is atomically executed. But transactions are not only about updating the database but also about ...

Read More »