HP 5991-5565 Manual de usuario Pagina 41

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 57
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 40
org.hibernate.Session hbsession = HibernateSessionFactory.getSession();
try{
Transaction tx = hbsession.beginTransaction();
Users users= new Users();
users.setFirstName("Smith");
users.setLastName("Barney");
hbsession.save(users);
hbsession.flush();
tx.commit();
}catch(HibernateException he){
he.printStackTrace();
}finally
{
if(hbsession!=null)
HibernateSessionFactory.closeSession();
}
NOTE: See Appendix D: Hibernate Test Application Source Code” (page 55) for the
complete source code.
11. Restart Tomcat to make the configuration effective by entering the following:
# $CATALINA_HOME/bin/shutdown.sh
# $CATALINA_HOME/bin/starup.sh
Verifying the Simple Application Operation
Verify that the simple application operates properly to ensure that the connection between Tomcat
to MySQL and Oracle is operational by opening a browser and entering the following website:
http://<YOUR_HOSTNAME>:8080/SimpleDemo/hibernate.jsp
The OSMS Hibernate Test web page is displayed as shown in Figure 14.
Figure 14 Verifying the Simple Application Configuration
Installing, Configuring, and Managing Web Server Middleware Stack Components 41
Vista de pagina 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 56 57

Comentarios a estos manuales

Sin comentarios