Search This Blog


Wednesday, 24 September 2014

Hibernate Introduction

  • Hibernate is an ORM (Object Relational Mapping) Tool
  • Hibernate is Open Source
  • Hibernate is used to persist data to Databases
  • Hibernate was started in 2001 by Gavin King
  • ORM is a programming method for mapping the objects to the relational model where entities/classes are mapped to tables,instances are mapped to rows and attributes of instances are mapped to columns of table.
  • Using Hibernate we can save data from Java Applications to Databases. This acts a medium between Java and Database. 

Wednesday, 12 September 2012

Unix Command passwd

One of the Unix Commands which is useful our day to day life is passwd. We will learn now how to use this command.

To change your password this command is useful.
How to change a password for your login:

Login to unix machine with your login id and enter your password
Now if you want to change the current password  passwd command is used to change password.
Type passwd in your command prompt:
Now machine will ask you to enter your current password,please enter it, then it will ask for new password
please enter new password ,the machine will ask again to confirm the new passward please enter it.

Now you changed your password now.

Tuesday, 28 August 2012

Email and URL validation in Javascript using Regular Expression

JavaScrip URL & Email Validation
Enter Valid URL :
Enter Valid Email :

Sunday, 18 December 2011

Difference between Statement and Prepared Statement


When you use normal statements compilation of statement or
parsing of statement will happen every time. This is time
consuming when u have multiple queries to execute.

Statement s = conn.createStatement();

Prepared Statement:
In prepared statement SQL query will be compiled or parsed
for the very first time and kept in some kind of pool. When
u execute one more time the same statement with different
values it saves the parsing time.

The PreparedStatement is a slightly more powerful version of a Statement, and should always be at least as quick and easy to handle as a Statement.

The PreparedStatement may be parametrized.
Prepared statement is precompiled statement it is used when
we want one query to be executed n no. of times.
Prepared Statement is Pre-compiled class , but Statement is not.
So in PreparedStatement the execution will be faster.

SQL select * from employee where employeeID=?,empName=?;
PreparedStatement ps = conn.PreparedStatement();

Callable Statement:

Callable statements are used to execute stored procedures
similar to java functions.

Tuesday, 6 December 2011

Object Class functions in java

Object Class
Object Class is the Super class for all classes in JAVA.The Object class defines the basic state and behavior that all objects must have, such as the ability to compare oneself to another object, to convert to a string, to wait on a condition variable, to notify other objects that a condition variable has changed, and to return the object's class.
The Object Class Functions:
This function is used to compare two objects whether they have equivalent values are not.
It returns true if they are equal else returns false.
The getClass() Method:
The getClass method is a final method (cannot be overridden)
This method returns a Class object.With this class you can get the information of object like name, its super class, and the names of the interfaces that it implements.
use of the getClass method is to create a new instance of a class without knowing what the class is at compile time. This sample method creates a new instance of the same class as obj which can be any class that inherits from Object (which means that it could be any class):
Object createNewInstanceOf(Object obj) {
return obj.getClass().newInstance();
The toString Method
Object's toString method returns a String representation of the object. You can use toString to display an object.
The Object class also provides five methods that are critical when writing multithreaded Java programs:
• notify
• notifyAll
• wait (three versions)
Returns a hash code value for the object.
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

Thursday, 1 December 2011


Some people dont know what is System,out,println in System.out.println.
As per my Knowledge,

System is a class in java which is final class(Final will stop inheritance)

out is a static final PrintStream object that is in System Class
And println is a function in PrintStream class
Since out is a static object with out creating object we can access

Thursday, 29 September 2011

Basics of Tables in MYSQL

A relational database system contains one or more objects called tables. The data or information for the database are stored in these tables. Tables are uniquely identified by their names and are comprised of columns and rows. Columns contain the column name, data type, and any other attributes for the column. Rows contain the records or data for the columns.

Example:Suppose you want to store the details of your company employees.
Generally Employees will have name, employee id,address.these properties we will represent them as columns.And the data of each employee will be as one Row.