BATIS Charpter 2 By0461097 0461006:0461084:0461097;*0461118:0461124
Charpter 2 By 0461097 0461006; 0461084;0461097; *0461118; 0461124
Review What is iBATIS iBATIS is an opening object/relation mapping persistance framework. It works for mapping the object to SQL sentence TWo core framework of iBATIS SQL Maps SQL Maps DAO
Review ⚫ What is iBATIS ? ⚫ iBATIS is an opening object/relation mapping persistance framework. It works for mapping the object to SQL sentence. ⚫ Two core framework of iBATIS: ⚫ SQL Maps ⚫ DAO
What is DAO DAO- Data Access object Data accessing interface Position between operation logic data Source effect: to abstract and encapsulate all access to the data source. The dao manages the connection with the data source to obtain and store data
What is DAO ? ⚫ DAO - Data Access Object ⚫ Data accessing interface ⚫ Position: between operation logic & data source ⚫ effect:to abstract and encapsulate all access to the data source. The DAO manages the connection with the data source to obtain and store data
What is DAO DAO is one of the standard J2EE design pattern Programmers use DAO to separate data access at low level from operation logic at high level
What is DAO ? ⚫ DAO is one of the standard J2EE design pattern. ⚫ Programmers use DAO to separate data access at low level from operation logic at high level
DAO With Microsoft o DAO is an application program interface (API) available with Microsoft's Visual basic that lets a programmer request access to a Microsoft Access database DAO was Microsoft's first object-oriented interface with databases. DAo objects encapsulate Accesss Jet functions o Through Jet functions, it can also access other Structured Query Language(SQL) databases
DAO with Microsoft ⚫ DAO is an application program interface(API) ⚫ available with Microsoft's Visual Basic that lets a programmer request access to a Microsoft Access database. ⚫ DAO was Microsoft's first object-oriented interface with databases. DAO objects encapsulate Access's Jet functions. ⚫ Through Jet functions, it can also access other Structured Query Language (SQL) databases
Basic Components for DAO A DAO factory A DAO interface A simple class implementing a DAO interface Data transmission object
Basic Components for DAO ⚫ A DAO factory ⚫ A DAO interface ⚫ A simple class implementing a DAO interface ⚫ Data transmission object
Application vs data source DAO eb application DB DAO Web application DB DAO ERP DAO Web application system DAO
Application vs. data source
DAO VS。 Service Service layer- business layer DAo layer-persistent layer interface DAO layer interact with data
DAO vs. Service ⚫ Service layer – business layer ⚫ DAO layer – persistent layer interface ⚫ DAO layer interact with data
Use of dao Data Source Encapsulation Connection conn= DAOFacotry create Connection( Driver, URL username, passpword Change database type getConnection(
Use of DAO ⚫ Data Source Encapsulation Connection conn = DAOFacotry.createConnection() ⚫ Driver, URL, username, passpword ⚫ Change database type getConnection()
Use of dao Database operation encapsulation CRUD-create, read, update, delete insertUser(User user)
Use of DAO ⚫ Database operation encapsulation ⚫ CRUD-create, read, update, delete ⚫ insertUser(User user)