Submitted by sneha on Mon, 11/02/2015 - 04:37
We will download and install Java EE 7 SDK which comes with GlassFish Open Source Edition 4 (currently 4.1.1)and then configure eclipse to deploy Java EE applications directly to GlassFish Server. You can download the latest Java EE 7 SDK from http://www.oracle.com/technetwork/java/javaee/downloads/index.html. You can also directly download the latest commercially supported GlassFish Server distribution (currently 3.1.2.2) from the same link.
Submitted by heartin on Sat, 10/31/2015 - 04:45
We can handle exceptions using the try-catch-finally construct or explicitly tell as being handled elsewhere through the use of throws clause in that method signature.
The try-catch-finally block will look as below:
try{
//Some code that can throw IOException
}
catch(Exception ex)
{
//do some workaround.
Submitted by heartin on Sat, 10/31/2015 - 04:37
Java 7 introduces few new features to the exception handling mechanism. We will discuss them quickly here.
Java 7 Multi-Catch Exceptions
With java 7, you can catch multiple exceptions using a single catch block as:
try {
File file = new File("filename.txt");
Scanner sc = new Scanner(file);
throw new SQLException();
}
catch (FileNotFoundException | SQLException e) {
Submitted by heartin on Wed, 10/28/2015 - 20:25
Problem
Given a binary tree, find out if it is a binary search tree or not.
Approach 1
Submitted by sneha on Mon, 10/26/2015 - 09:22
Hibernate provide Criteria Queries as an object-oriented alternative to HQL. Criteria Query is used to modify the objects and provide restriction for the objects. Many complex queries in HQL or even SQL may become larger over a period of time and spread over many lines; and will be difficult to update and maintain. We have already seen HQL in http://javajee.com/introduction-to-hibernate-query-language-hql-in-hibernate-43.