Java CRUD Operations using MySQL For Beginners

MariaDB and MySQL database servers

Two things decide whether Java CRUD against MySQL works: the right connector artifact on the classpath, and parameters instead of string concatenation. The artifact is com.mysql:mysql-connector-j — the old mysql:mysql-connector-java is dead, and its last release on Maven Central is 8.0.33, published 2023-04-14. Use: <dependency> <groupId>com.mysql</groupId> <artifactId>mysql-connector-j</artifactId> <version>26.7.0</version> </dependency> You do not need Class.forName(…). The … Read more

TestNG Listener Callback Order: What Actually Fires

testng listeners

Run java -cp testng-7.12.0.jar:jcommander-1.83.jar:slf4j-api-2.0.16.jar:. org.testng.TestNG -testclass YourTest and TestNG calls your listeners in a fixed order: suite-level first, then per-method onTestStart → beforeInvocation → your test body → afterInvocation → the pass/fail/skip callback, repeated per method, then suite-level again on the way out. That order — and what happens to a listener when a test … Read more

REST Assured Interview Questions, Checked Against 6.0.1

rest assured interview questions

Before you rehearse any of this: check the version. In August 2026, REST Assured’s current release on Maven Central was 6.0.1, published 2026-07-10. A 4.4.0 entry in pom.xml is two major versions behind, and the 5.x-to-6.x jump changed the Java baseline. I read the class file headers out of three released jars: rest-assured 4.4.0: io/restassured/RestAssured.class … Read more

Format Java in Visual Studio Code: Formatter Setup

vs code format

To format Java in Visual Studio Code (VS Code), install the Language Support for Java(TM) extension by Red Hat (redhat.java), open a .java file and run Format Document: Shift+Alt+F on Windows, Ctrl+Shift+I on Linux, Shift+Option+F on macOS. To format on every save, turn on editor.formatOnSave. To use a style such as Google’s, point java.format.settings.url at … Read more

Java Distributions Compared by Support Window and Licensing

top java distributions

As of October 2026, Java 25 is the current LTS. Unless something forces an older line, I would run it from a free, TCK-certified build of OpenJDK: Eclipse Temurin if nothing else decides for you. JDK 27 reached general availability on 15 September 2026, but it is a six-month release: Temurin and SapMachine list March … Read more

Understanding Java Memory Leaks and Free Tools For Detection

java memory leak

A Java memory leak is an object that is unreachable to your program but still reachable from a GC root, so the collector cannot free it. The fastest way to confirm you have one, on any JDK 8+: run jmap -histo:live <pid> twice, a minute apart. :live forces a full GC first, so anything that … Read more

HashMap vs Hashtable: Key Differences and Usage Guide

java hashmap

Use HashMap for single-threaded code and ConcurrentHashMap when threads share the map. Do not use Hashtable in new code. The differences that actually matter: HashMap accepts a null key and null values, Hashtable throws NullPointerException for either; Hashtable‘s methods are synchronized and HashMap‘s are not; and Hashtable is a legacy class kept for compatibility. Every … Read more