Posts

Spring and Hibernate Integration....

Integrating Hibernate with Spring I tried to learn how to integrate Hibernate with Spring and found very useful information in Spring in Action by Craig Walls. Before getting started let me tell you about the example I have used in this article. I am having a very basic table in database CREATE TABLE sample ( id int ( 10) unsigned NOT NULL AUTO_INCREMENT, name varchar ( 45) NOT NULL , city varchar ( 45) NOT NULL , PRIMARY KEY ( id) ) ; and here is Sample.hbm.xml < ? xml version = "1.0" ? > < ! DOCTYPE hibernate - mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > < hibernate - mapping > < class name = "hibernate.Sample" table = "sample" lazy = "false" > < id name = "id" column = "id" type = "java.lang.Long" > ...

Java Interview Questions

1)Why pointeres are eliminated from java.? Ans) 1.Pointers lead to confusion for a programmer. 2. Pointers may crash a program easily, for example , when we add two pointers, the program crashers immediately. 3. Pointers break security. Using pointers, harmful programs like Virus and other hacking programs can be developed. Because of the above reasons, pointers have been eliminated from java. 2) What is the difference between a function and a method.? Ans). A method is a function that is written in a class. We do not have functions in java; instead we have methods. This means whenever a function is written in java,it should be written inside the class only. But if we take C++, we can write the funtions inside as well as outside the class . So in C++, they are called member funcitons and not methods. 3) Which part of JVM will allocate the memory for a java program.? Ans). Class loader subsystem of JVM will allocate the necessary memory needed by the java progr...