HP 5991-5565 Instrukcja Użytkownika Strona 41

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 57
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 56 57

Komentarze do niniejszej Instrukcji

Brak uwag