Inner class is a class defined inside other class and act like a member of the enclosing class.
There are two main types of inner classes
Static member class
Inner class
Member class
Anonymous class
Local class
Static member class
A static member class behaves much like an ordinary top-level class, except that it can access the static members of the outer.
Outer class can access all inner class fields by referring...
Saturday, 29 December 2018
Friday, 21 December 2018
JDBC Interview Questions
ACID Properties in DBMS?
A transaction is a single logical unit of work which accesses and possibly modifies the contents of a database. Transactions access data using read and write operations.In order to maintain consistency in a database, before and after transaction, certain properties are followed. These are called ACID properties.
Atomicity
By this, we mean that either the entire transaction takes place at once or doesn’t...
Hibernate Interview Questions

filter employees with same salary count greater than five (group by salary) using hibernate criteria?
Session session = getCurrentSession();
ProjectionList projectionList = Projections.projectionList();
projectionList.add(Projections.groupProperty("totalCode"))
.add(Projections.groupProperty("activityCode"))
...
Friday, 7 December 2018
Java program to capitalize first letter of each word in string
public class FirstWordUpperCase {
public static void main(String[] args) {
System.out.println(changeString("how are you man"));
}
private static String changeString(String str) {
StringBuffer sb = new StringBuffer();
String[] arr = str.split("\\s");
for (int i = 0; i < arr.length; i++) {
sb.append(Character.toUpperCase(arr[i].charAt(0))).
append(arr[i].substring(1)).append(" ");
}
return sb.toString();
...
JSP Interview Questions
How to disable caching on back button of the browser?
<%
response.setHeader(“Cache-Control”,”no-store”);
response.setHeader(“Pragma”,”no-cache”);
response.setHeader (“Expires”, “0”); //prevents caching at the proxy server
%>
...
Wednesday, 5 December 2018
Hibernate one to one mapping

In this kind of association, a foreign key column is created in owner entity. For example, if we make EmployeeEntity owner, then a extra column "ACCOUNT_ID" will be created in Employee table. This column will store the foreign key for Account table.
To make such association, refer the Account entity in EmployeeEntity class as follow:
@OneToOne
@JoinColumn(name="ACCOUNT_ID")
private...
Hibernate Many-To-One Bidirectional

One table has a foreign key column that references the primary key of associated table.In Bidirectional relationship, both side navigation is possible.
We are discussing an example of Student and University relationship. Many student can enroll at one University. And one University can have many students.
@Entity
@Table(name =...
Many to Many Annotation

In this scenario, any given employee can be assigned to multiple projects and a project may have multiple employees working for it, leading to a many-to-many association between the two.
We have an employee table with employee_id as its primary key and a project table with project_id as its primary key. A join table employee_project is...