{"id":67448,"date":"2021-07-22T04:10:06","date_gmt":"2021-07-22T08:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/spring-and-ibatis-some-notes-will-be-updated-later-java-short-notes\/"},"modified":"2022-05-10T20:12:11","modified_gmt":"2022-05-11T00:12:11","slug":"spring-and-ibatis-some-notes-will-be-updated-later-java-short-notes","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=67448","title":{"rendered":"Spring and iBatis: Some Notes [Will be updated later] #Java Short Notes"},"content":{"rendered":"<p>Implementing the data access layer of a Spring application using iBATIS. <br \/>Spring Framework and IBATIS<\/p>\n<p>You can use JDBC with Spring for sure. Spring also simplifies the use of JDBC. iBATIS can provide one more step in simplification. Using iBATIS, you can mapdata and Java objects, also make use of simplified database operations.<\/p>\n<p>Using iBatis with Spring involves three steps<br \/>Configuration: Configure various files at Data layer to be able to use iBatis<br \/>Mapping files: The mapping of the selected rows to the properties of the domain objects.<br \/>CRUD Operations: Learn how to use iBatis for select, delete, and update operations.<\/p>\n<p>iBatis Notes:<br \/>allows the developer to write the custom SQL code they need to populate the bean properties<br \/>In a Spring iBATIS application, you need to configure the reference file and the mapping files. <br \/>org.springframework.orm.ibatis.SqlMapClientFactoryBean takes care of loading the configuration files. <br \/>You should not create and manage database transactions manually in the iBATIS mapping files. Always delegate the transaction management to Spring<br \/>In reference configuration file, you can list the sqlmap files.<br \/>You also need to use spring context file (applicationContext.xml ) that will link all configuration file together<br \/>it is a good idea to create a separate sqlMap file for each domain object.<br \/>Domain objects are POJOs<br \/>Mapping files for domains:<\/p>\n<pre>                                                         select * from Test     <\/pre>\n<p>Configuring iBATIS and Spring<br \/>Define the TestDao interface for example and its iBATIS implementation and then add the familiar dataSource bean.<br \/>Use the applicationContext.xml file to link the beans together.<\/p>\n<p>usage in a sample application:<br \/>context = new ClassPathXmlApplicationContext(&#8220;applicationContext.xml&#8221;);<br \/>TestDao testDao = (TestDao)context.getBean(&#8220;testDao&#8221;);<\/p>\n<p>Use select operation:<br \/>Add methods in the DAo as follows:<br \/> public List getAll() {<br \/>        return getSqlMapClientTemplate().queryForList(&#8220;getAllTests&#8221;, null);<br \/>    }<\/p>\n<p> From: http:\/\/sitestree.com\/?p=5154<br \/> Categories:Java Short Notes<br \/>Tags:<br \/> Post Data:2012-08-13 08:19:19<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Implementing the data access layer of a Spring application using iBATIS. Spring Framework and IBATIS You can use JDBC with Spring for sure. Spring also simplifies the use of JDBC. iBATIS can provide one more step in simplification. Using iBATIS, you can mapdata and Java objects, also make use of simplified database operations. Using iBatis &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=67448\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917,1956],"tags":[],"class_list":["post-67448","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","category-java-spring","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":67452,"url":"http:\/\/bangla.sitestree.com\/?p=67452","url_meta":{"origin":67448,"position":0},"title":"iBATIS: Some Notes #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 22, 2021","format":false,"excerpt":"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. Spring config file (applicationContext.xml) - Define database connection parameters, the location of the SQL Map config file, and one or more Spring beans for\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65920,"url":"http:\/\/bangla.sitestree.com\/?p=65920","url_meta":{"origin":67448,"position":1},"title":"What is Spring Framework? What does it mean to J2EE developers #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 17, 2021","format":false,"excerpt":"What is Spring Framework? What does it mean to J2EE developers? Spring is a light-weight framework, very often referred as an alternative\/competitor to EJB, for the development of enterprise-type applications. Spring provides many features such as declarative transaction management, access to remote logic using RMI or web services, mailing facilities\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65975,"url":"http:\/\/bangla.sitestree.com\/?p=65975","url_meta":{"origin":67448,"position":2},"title":"Introduction to Spring #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 18, 2021","format":false,"excerpt":"Open-sourced on February, 2003 Layered J2EE application framework Inversion of Control (IoC): A Data Access Object (DAO) depends on a DataSource. Allows: code to interfaces Spring has classes to support Hibernate, Struts, and other frameworks According to many Java developers [ref:internet], J2EE patterns are sometimes cumbersome. Spring uses patterns but\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65971,"url":"http:\/\/bangla.sitestree.com\/?p=65971","url_meta":{"origin":67448,"position":3},"title":"Java Spring Topics: What spring framework brings to the table #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 18, 2021","format":false,"excerpt":"Java Spring TopicsKnowing the buzzwords does not make anyone a good developer. However, it helps. Being expert in a technology like Spring in one day is not possible, but initially getting familiar with all the aspects is helpful as you will know which Spring feature is required to solve the\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65910,"url":"http:\/\/bangla.sitestree.com\/?p=65910","url_meta":{"origin":67448,"position":4},"title":"MVC : Struts : Java : Industry Web Application #Java Short Notes","author":"Sayed","date":"July 17, 2021","format":false,"excerpt":"Industries use frameworks for application development quite often. For example: Java concepts like JSP, Servlet, Swing, Bean, JDBC can be used directly to create web-applications but when such applications become big, it becomes difficult to maintain and develop them further. Hence, frameworks like struts are used to develop large web-based\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69111,"url":"http:\/\/bangla.sitestree.com\/?p=69111","url_meta":{"origin":67448,"position":5},"title":"What is Hibernate? What does it mean to J2EE developers #48","author":"Author-Check- Article-or-Video","date":"August 12, 2021","format":false,"excerpt":"What is Hibernate? What does it mean to J2EE developersHibernate is an open source free Java package that provides easy and efficient ways to deal with relational databases. Hibernate gives the abstraction that your databases contain just objects rather than tables. You manipulate objects to insert data or to get\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/67448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67448"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/67448\/revisions"}],"predecessor-version":[{"id":74583,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/67448\/revisions\/74583"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67448"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}