Myeclipse 平臺下開發(fā)Hibernate入門實例
Posted on 2007-09-16 15:14 TuringJava 閱讀(493) 評論(0) 編輯 收藏 所屬分類: Hibernate最近正在學(xué)習(xí)Hibernate,利用的是Myeclipse開發(fā)平臺,在網(wǎng)上轉(zhuǎn)悠了一大圈找到了幾個比較好的入門學(xué)習(xí)實例。
Example1:http://www.myeclipseide.com/images/tutorials/quickstarts/introduction_to_hibernate/tutorial.html
Example2:http://www.myeclipseide.com/documentation/quickstarts/hibernate/
Example3:http://www.roseindia.net/hibernate/firstexample.shtml
Simple Introduce to Hibernate:
1.Hibernate is an OR-mapping technology that is used to map database structures to Java objects at runtime.
2. Two important configuration files:
開發(fā)過程:
1.Config the hibernate.cfg.xml to connect the DataBase
2.Writting the Persistance Class -POJO
3.Mapping the POJO toDB, using **.hbm.xml
4.Develop the Application
Example1:http://www.myeclipseide.com/images/tutorials/quickstarts/introduction_to_hibernate/tutorial.html
Example2:http://www.myeclipseide.com/documentation/quickstarts/hibernate/
Example3:http://www.roseindia.net/hibernate/firstexample.shtml
Simple Introduce to Hibernate:
1.Hibernate is an OR-mapping technology that is used to map database structures to Java objects at runtime.
2. Two important configuration files:
hibernate.cfg.xml. On startup, Hibernate consults this XML file for its operating properties, such as database connection string and password, database dialect, and mapping files locations. Hibernate searches for this file on the classpath.
mapping description file (file extension *.hbm) that instructs Hibernate how to map data between a specific Java class and one or more database tables.
3.user for
Hibernate may be used by any Java application that requires moving data between Java application objects and database tables. Thus, it's very useful in developing two and three-tier J2EE applications. Integration of Hibernate into your application involves:
- Installing the Hibernate core and support JAR libraries into your project
- Creating a hibernate.cfg.xml file to describe how to access your database
- Creating individual mapping descriptor files for each persistable Java classes
開發(fā)過程:
1.Config the hibernate.cfg.xml to connect the DataBase
2.Writting the Persistance Class -POJO
3.Mapping the POJO toDB, using **.hbm.xml
4.Develop the Application