Skip to content


I am using batchUpdate() to insert multiple records in a table. As per the requirement, if there is a duplicate value for a primary key while inserting it should be updated with the latest received data, hence I was trying to use ON DUPLICATE KEY UPDATE in INSERT statement. The ON DUPLICATE KEY UPDATE works good when I use a

Why can I not use “super” variable from a static context, even though “super” refers to the parent class and NOT a class instance, unlike “this”?

I’m talking java language. Variable “this”, when used inside a class, refers to the current instance of that class, which means you cannot use “this” inside a static method. But “super”, when used inside a class, refers to the superclass of that class, not an instance of the superclass, which should mean that you can use “super” inside a static

Eclipse autogenerated toString() method

As par as I know concatinate String using + sign is not a good practice when you have large number of String. But when I check on eclipse generated toString() method (Write click on source file -> …

Using a generic class to perform basic arithmetic operations

I want to perform basic arithmetic operations like addition, subtraction, multiplication and division using only one generic method per operation for wrapper types like Integer, Float, Double … (excluding BigDecimal and BigInteger). I have tried to do something like the following (for addition) using a generic class. It issues a compile-time error, operator + cannot be applied to E,E Is

How to create Java gradle project

How to create Java Gradle project from command line? It should create standard maven folder layout like on the picture below. UPDATE: .1. From…