Problem
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. Continue reading
Author Archives: James
Create and Start a Thread in Java
Threads are lightweight sub-processes which share the same address space and data, and can execute different tasks concurrently. Compared to processes, context switching between threads is less expensive. In Java environment, a Java thread is an instance of Thread class or its subclasses. Continue reading
Two Sum – LeetCode
Problem
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-based. Continue reading
Hibernate Session
The main function of a Hibernate session is to open a database connection, and offer read and update operations for instances. Each instance object associated with the session will keep alive until the session is closed or the object is deleted. Continue reading
JDBC CallableStatement
A CallableStatement is used to call stored procedures in a database. The post (“JDBC Batch Update”) will give a simple example, and show how to use JDBC CallableStatement to call stored procedures. Continue reading
JDBC Batch Update
The post (“JDBC Batch Update”) will give an example, and show how to use JDBC batch update. Continue reading
JDBC Delete Record Using PreparedStatement
The post (“JDBC Delete Record Using PreparedStatement”) will give an example, and show how to delete a record using PreparedStatement. Continue reading
JDBC Delete Record Using Statement
The post (“JDBC Delete Record Using Statement”) will give an example, and show how to delete a record using Statement. Continue reading
JDBC Update Record Using PreparedStatement
The post (“JDBC Update Record Using PreparedStatement”) will give an example, and show how to update records using JDBC PreparedStatement. Continue reading
JDBC Update Records Using Statement
The post (“JDBC Update Records”) will give an example, and show how to update records. Continue reading