java Archive

xPath Processing for XML documents using Java

As defined earlier, XPath is a language for finding and searching information in an XML document using Path Expressions which is similar to the file system syntax. 1 If you can using Eclipse or other IDE, you may create a new project. 2 Create a new class named : ReadXPath 3 Copy ...Read More

Making Connection to Oracle Database System with Java

Oracle Database Creation 1 Open your Apex for Oracle: Click on Start -> All Programs -> Oracle database 11g Express Edition -> Go to Database Home Page 2 Visit the SQL Command : SQL -> SQL Command 3 Execute the following SQL to create a table called friends. create table friends( fname ...Read More

Database Porgramming : Creating a simple phone book using Java & a database ( HSQLDB )

In one of the last tutorial, we have created a simple phonebook system using a text file and Java Programming. For more details, click here. In this tutorial, we will be creating the same project but with the integration of a simple database management system called ( HSQLDB ). The program will ...Read More

Java & HSQLDB : Connecting to a DBMS (HSQLDB) from Java Program

1) Create a simple file and call it Here is a simple code written in Java to connect to a DBMS : import*; import java.sql.*; import java.util.*; public class Simple { public static void main(String args) { Connection con=null;; try { Class.forName("org.hsqldb.jdbc.JDBCDriver"); con=DriverManager.getConnection("jdbc:hsqldb:mydbb","SA",""); con.createStatement().executeUpdate("SET DATABASE SQL SYNTAX MYS TRUE"); con.createStatement().executeUpdate("create ...Read More

Java Programming : Creating a Phonebook using a simple CSV file

In this tutorial, we will create a simple phonebook system using a text file. This is without accessing or using any advanced database management system like Access, MySQL or Oracle. The program will be a textual interactive application without a graphical interface for the sake of simplicity ! We will be having ...Read More

Installing & Configuring Java Development Kit ( JDK )

1. You need to download the Java Development Kit ( JDK ) from Oracle website. 2. Double click on the downloaded file [jdk-7-windows-i586.exe]   3. Click : Start -> right click on Computer -> click on Properties   4. Click on Advanced system settings 5. Click on Environment Variables 6. Choose ...Read More

Java Simple Program to write text data to a file

1. Open Eclipse and REMEMBER the workspace location 2. New project : MyWriteFileProj   [ Click here for steps to create a new project ] 3. New Class under the project : MyWriteFile 4. Type in the following code under your class : MyWriteFile import*; public class MyWriteFile { public static void ...Read More