Create Zip archive using Java

An example of compress file into zip file in java.

 Reference

1.http://docs.oracle.com/javase/6/docs/api/java/util/zip/ZipOutputStream.html

read more

Connect to DB2 in Java

db2

An Example of connecting to DB2 Database using JDBC Driver.

A typical example code of connect to database will look like this

read more

Connect to PostgreSQL in Java

postgre

An Example of connecting to PostgreSQL using JDBC Driver.

A typical example code of connect to database will look like this

read more

Connect to MySQL in Java

mysql

An Example of connecting to MySQL using JDBC Driver.

A typical example code of connect to database will look like this

read more

Download JDBC Driver

A JDBC driver is a software component enabling a Java application to interact with a database[1]
You can either download the JDBC driver from the database vendor/provider website (But usually they come with the database installation.)
Below are the list of database vendor and their website url.

read more

Write Dom to Xml File (LSSerializer)

 

Example Output : justexample.xml

Reference
http://docs.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/ls/class-use/LSOutput.html
http://docs.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/bootstrap/DOMImplementationRegistry.html
http://docs.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/ls/DOMImplementationLS.html

read more

Read a XML file (LS-DOM)

Sample file : justexample.xml

Example Output

Reference
http://docs.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/ls/DOMImplementationLS.html

read more

Write Dom to Xml File (Transformer)

This example show you how to construct a Java Document Object Model (DOM) using DOM API and then write the DOM object into XML file.
 

Example Output : justexample.xml

Reference
http://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/transform/Transformer.html#transform(javax.xml.transform.Source, javax.xml.transform.Result)

read more