HP 5991-5565 Manuel d'utilisateur Page 41

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 57
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 56 57

Commentaires sur ces manuels

Pas de commentaire