41JavaEECRM(213001)JavaEEJavaEEVODAOSpringJDBCSpringImplementationofTelecomCRMDataPersistentLayerBasedonJavaEEZHANGLi(CollegeofComputerScience&Engineering,JiangsuTeachersCollegeofTechnology,Changzhou213001)AbstractCombinedwiththepracticalrequirementintheinformatizationprocessoftheChinaTelecomCommission,JavaEEarchitectureisintroduced,andamethodfordevelopinglargescaletelecomCustomRelationshipManagement(CRM)datapersistentlayerontheplatformofJavaEE.Thispaperalsoanalyzestheapplicationoffaçadepattern,VOpatternandDAOpatternintheSpringJDBCframework,whichimplementstheloosecouplinginpersistentlayer.Thewholesystemhasbetterperformanceofstability,flexibilityandextension.KeywordstelecomCRMsystem;Springframework;designmodeComputerEngineering356Vol.35No.620093March2009··10003428(2009)06004103ATP393.021(CustomerRelationshipManagement,CRM)SpringJDBCJavaEE[1]3(1)(2)(3)JDBCBatchPreapredStatementBatchSizeFetchSizecacheviewstoreprocedure()22.1(1)SFA(2)(3)SFA2.2(1)(2)(3)(4)(5)(6)2.3(1)168h(08KJD520005)(1977)JavaEE2008-09-10E-mailzhangli_3913@yahoo.com.cn42(2)2.42.5CRM1CRM133.1FacadeVODAO3.2SpringSpringAOP()SpringIoC/DI3.3[2]FacadeVODAOSpringJDBCJavaEE2FacadeDao1FacadeDao3FacadeDao2Dao5Dao4Dao3Dao2Dao1Dao6Dao1implDao2implDao4implDao5implDao6implDao3implServices3Services2Services1DataSourceSpringConfigBeanFactoryDAOJDBCDriverRDBMSJdbcTemplateusersusersusersFacadeBusinessServices2JavaEE2(1)FacadeBusinessServiceServiceFaçadeFacadeDaoFacadeDaoFacadeServiceServiceBusinessService(2)FacadeFacadeBusinessService(3)Facade4CRM4.1(1)Facade(2)(3)DAO(4)Façade4.2SpringJDBCCRM[3-4]CRM233t_usercompact()t_usertrace()t_userremind()t_userrelation()t_userinfo()t_userloss()t_userdata()4.2.1SpringJDBCSpringJDBCValueObjects(VO)DataAccessObjects(DAO)VODAOVO7VOVO43VOJavaBeangetter/setterDAOVOVODAOUserRelationDAO,UserInfoDAO,UserRemindDAO,UserDataDAO7DAODataAccess0bject(DataAccess0biectinsert(UserRelationvo),update(UserRelationvo),delete(UserRelationvo))SpringJDBCSpringJDBCApplicationContext.xmlbeanbeanid=dataSourceclass=org.apache.commons.dbcp.BasicDataSourcedestroy-method=close!--MySQL--propertyname=driverClassNamevalue=com.mysql.jdbc.Driver/!--URL--propertyname=urlvalue=jdbc:mysql:///localhost:3306/CRM/!----propertyname=usernamevalue=root/!----propertyname=passwordvalue=root//bean4.2.2SpringApplicationContext.xmltransactionManagerAOPbeanid=transactionManagerclass=org.springframework.jdbc.datasource.DataSourceTransactionManagerpropertyname=dataSourcereflocal=dataSource//property/bean4.2.3SpringIoCDAOSpringsetterapplicationContext.xmlUserRemindDAObeanid=UserRemindDAOclass=com.crm.dao.UserRemindDAOpropertyname=dataSourcereflocal=dataSource//property/bean4.2.4isExist()JdbcTemplatequeryForInt()SQL0truefalsepublicbooleanisExist(StringassetName){JdbcTemplatejdbcTemplate=newJdbcTemplate(dateSource);Stringsql=SELECTcount(*)FROMuserremindWHEREusername=+username;Intcount=jdbcTemplate.queryForInt(sql);if(count0){returntrue;}else{returnfalse;}}SpringJDBC4.2.5SpringFacadebeanid=UserFacadeclass=com.crm.facade.UserFacade!-DAOFacade-propertyname=UserRemindDAOref=UserRemindDAO/…/property/beanServicepublicclassuserFacade{privateUserRemindDAOuserRemindDao;…publicvoidsetUserRemindDao(UserRemindDaodao){this.UserRemindDao=dao;}…}5FacadeVODAOSpring(1)(2)DAO(3)[1].J2EE[J].,2007,33(5):272-274.[2],,.AOPComposite[J].,2008,34(10):73-74,77.[3],,.J2EE[J].,2008,34(6):266-267.[4],,.Web[J].,2006,32(22):274-276.