iBATIS: Some Notes #Java Short Notes

  • You can download iBatis library from http://ibatis.apache.org/. Just make the Jar files available to your application
  • iBatis with Spring: Need to configure at least three files.
    1. Spring config file (applicationContext.xml) – Define database connection parameters, the location of the SQL Map config file, and one or more Spring beans for use within the application in Spring Config file.
    2. SQL Map config (SqlMapConfig.xml) – Define any iBATIS-specific configuration settings, and declare the location of SQL Map files in SQL Map config file
    3. SQL Map(s) (domainObject.xml) — SQL Map files typically map domain objects (POJOs) to database objects [tables]
  • In iBATIS web application, you need to use web.xml file as well
  • Steps in writing a simple iBATIS application
    • Write a POJO for the domain object
    • Create database table to represent the domain object
    • Use the Spring configuration file to configure properties, and JDBC DataSources (iBATIS SimpleDataSource, Jakarta DBCP (Commons), and any DataSource that can be looked up via a JNDI context), define location of SQL Map file, define beans
    • The sqlMap property must be wired with a reference to an iBATIS SqlMap-Client (through SqlMapClientFactoryBean) (Spring configuration file)
    • Configure SQL Map file (SqlMapConfig.xml): For domain objects list sql map files
    • Create actual SQL Map files that will contain SQL code and the mappings for parameter objects and result objects
    • Start writing Java code. Start with the service layer. Service interface, service Interface implementation with methods for database operation using iBatis
    • Write iBatis test client that will make use of the service interfaces for database operations

From: http://sitestree.com/?p=5157
Categories:Java Short Notes
Tags:
Post Data:2008-07-11 00:50:30

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada