The post (“JDBC Create Table”) will give an example, and show how to create a table using JDBC. Continue reading
Category Archives: Java
JDBC Drop Database
The post (“JDBC Drop Database”) will give an example, and show how to drop a database using JDBC. Continue reading
JDBC Create Database
The post (“JDBC Create Database”) will give an example, and show how to create a database using JDBC. Continue reading
Get JDBC Connection
To get JDBC connection, normally there are two ways: 1. database driver manager 2. use data source Continue reading
JDBC by Examples
The Java Database Connectivity (JDBC) API is a collection of classes and interfaces, and is the industry standard for database-independent connectivity between the Java programming language and a wide range of databases and other tabular data sources. Continue reading
Send HTTP Get Request in Java
The post will give two examples to send HTTP GET requests using Java standard API or using Apache HttpClient.
1. The example using Java API URLConnection Continue reading
Send HTTP POST request in Java
The post will give two examples to send HTTP POST requests using Java standard API and Apache HttpClient.
1. The example using Java API HttpURLConnection Continue reading
Synchronized vs ReentrantLock in Java
Synchronized
, ReentrantLock
and AtomicInteger
are used in many projects to help solve concurrency issue and thread safety. The post will compare Synchronized and ReentrantLock. Continue reading
Convert Byte to Bit String (Java)
It will give one implementation on how to convert byte to bit string (8 bits). For example: byte 5 will change to “00000101”, byte 8 will be “00001000”. Continue reading
Configure c3p0 Connection Pool in Hibernate
Normally, opening a connection to a database consumes more time than executing an SQL statement. Connection pools can help to reuse some connections without creating the connections frequently. In DAO layer, it will help to improve your system performance. Continue reading