I have learned IBatis and I want to use the IBatis framework in my application.
After going through some documents I read something abut IBatis DAO pattern. But I am not really sure how and why one should use IBatis DAO pattern. Could anyone help me out in this. What I basically want to know is that am I free to write my own DAO class with IBatis or do I have to use IBatis DAO pattern ?
I have following sample test class to access sqlMap-config.xml file [dont worry about the syntax if something is missing or wrong ].
Can this file be called a DAO ?
public class IBatis
private static SqlMapClient sqlMap = null;
private static String resource = "com\\myorg\\test\\resource\\sqlMap-config.xml";
If you are referring to the DAO API that used to be included with iBatis, that is deprecated and shouldn't be used anymore as it is no longer maintained. What you have written is not a DAO. It is a class that inserts a Department. But you have no methods for reusing this class outside of itself. A DAO is an object that provides data access methods like insert, delete, findByFirstName, etc that deals with a specific entity.
While this article might be a bit beyond where your learning process is at the moment, it might help give you an idea of what a DAO actually is.
I thank you from the bottom of my heart for the reply. I went through your artcile and the DAO concept is clear to me know. You know sometimes it is so nice if someone clears your confusion in a minute when you are going thru a barrage of document trying to understand a new thing. Thanks once again.