Posts

Showing posts with the label program

hibernate sample application with example

Hibernate is ORM(Object Relational Mapping) framework for mapping java object with database table. A brief description about Configuration, SessionFactory, Session, Query, Criteria, Transaction and follow the same for sample application creation using hibernate. Configuration:   Configuration is that the initial object you wish to make any of hibernate application and typically making one time throughout the applying initialization. It represents the configuration or properties file providing by hibernate. SessionFactory:   Configuration object is employed to make SessionFactory instance that intern configures hibernate for the applying. SessionFactory object is significant weight part, it's created throughout application start up time and unbroken for later use. The way to do this we are going to see in below application. We would like one SessionFactory object per info employing a separate configuration. Therefore if you victimization multiple databases then you'd ou

ORM features in hibernate

Image
Hibernate is Object Relational Mapping(ORM) framework. Hibernate has the advantages while comparing with JDBC. That advantages will make developer life will be easy were implementing or maintaining the java application. Hibernate ORM features are, Hibernate gives the support of POJO/POJI model programming. It is also API independent. Light weight technology, no need of web or application servers. No byte code enhancement like EJB. Supports inheritance and polymorphism features. EJB component do not support inheritance. Pluggable with any Java/JEE or framework software based applications. The persistence logic of hibernate application can be access from all type of java client application. Gives implicit middleware services like jdbc connection pooling, transaction management etc.., Gives support to work with third party jdbc connection pooling. Support to call stored procedures and functions. Supports database independent query language

Control statements

Statement similar to smallest unit which completes instruction in itself. So, every statement will get end with semicolon(;) in java.In java there are majorly sequential and control statements are available. if, while, do-while, for, switch, break, continue, return statement will come under the Control statements.         1. sequential statements: These are the statements that executes one by one. 1 2 3 4 5 System . out . println ( "Hello" ); x = y + z ; System . out . println ( x );         These statements can be executed by JVM one by one in a sequential manner, that are called sequential statements . But this type of sequential execution is useful only to write simple programs . If we want to write better and complex programs, we need better control on the flow of execution. This is possible by using conditional statements.          2. control statements: Control statements are the statements which alter the flow of execution and provide better