当前位置: 首页 > news >正文

免费网络短剧网站网络宣传渠道有哪些

免费网络短剧网站,网络宣传渠道有哪些,网站建设需要方案,大连工程信息建设网​ mybatis整合 主要是处理dao包下的接口和xml文件#xff0c;以及service下的类和接口 第一步 在resource目录下创建mybatis-config.xml文件【注意点#xff1a;mybatis-config.xml文件下通常都是写别名、和mappers】 ?xml version1.0 encodingU…​ mybatis整合 主要是处理dao包下的接口和xml文件以及service下的类和接口 第一步 在resource目录下创建mybatis-config.xml文件【注意点mybatis-config.xml文件下通常都是写别名、和mappers】 ?xml version1.0 encodingUTF-8 ? !DOCTYPE configurationPUBLIC -//mybatis.org//DTD Config 3.0//ENhttp://mybatis.org/dtd/mybatis-3-config.dtd configurationtypeAliasestypeAlias typecom.pojo.Books aliasbooks//typeAliasesmappersmapper classcom.dao.BooksMapper//mappers /configuration第二步 dao和service包下的文件 dao包 public interface BooksMapper {int add(Books books);int delete(int bookID);int update(Books books);Books selectById(int bookID);ListBooks selectAll(); } ?xml version1.0 encodingUTF-8 ? !DOCTYPE mapperPUBLIC -//mybatis.org//DTD Config 3.0//ENhttp://mybatis.org/dtd/mybatis-3-mapper.dtd mapper namespacecom.dao.BooksMapperinsert idadd parameterTypebooksinsert into books(bookID,bookName,bookCount,detail) values (#{bookID},#{bookName},#{bookCount},#{detail})/insertdelete iddelete parameterTypeintdelete from books where bookID#{bookID}/deleteupdate idupdate parameterTypebooksupdate books set bookName#{bookName},bookCount#{bookCount},detail#{detail} where bookID#{bookID}/updateselect idselectById resultTypebooksselect * from books where bookID#{bookID};/selectselect idselectAll resultTypebooksselect * from books/select /mapperservice包 public interface BooksService {int add(Books books);int delete(int bookID);int update(Books books);Books selectById(int bookID);ListBooks selectAll(); } public class BooksServiceImpl implements BooksService {private BooksMapper booksMapper;public void setBooksMapper(BooksMapper booksMapper) {this.booksMapper booksMapper;}public int add(Books books) {return booksMapper.add(books);}public int delete(int bookID) {return booksMapper.delete(bookID);}public int update(Books books) {return booksMapper.update(books);}public Books selectById(int bookID) {return booksMapper.selectById(bookID);}public ListBooks selectAll() {return booksMapper.selectAll();} }【注意点这里的serviceImpl别忘了给它set注入】 第三步 最后需要在总的spring.xml文件中导入包 import resourceclasspath:spring-dao.xml/spring整合 第一步 配置整合mybatis 关联数据库文件 context:property-placeholder locationclasspath:database.properties/数据库连接池 bean iddataSource classcom.mchange.v2.c3p0.ComboPooledDataSource!-- 配置连接池属性 --property namedriverClass value${jdbc.driver}/property namejdbcUrl value${jdbc.url}/property nameuser value${jdbc.username}/property namepassword value${jdbc.password}/!-- c3p0连接池的私有属性 --property namemaxPoolSize value30/property nameminPoolSize value10/!-- 关闭连接后不自动commit --property nameautoCommitOnClose valuefalse/!-- 获取连接超时时间 --property namecheckoutTimeout value10000/!-- 当获取连接失败重试次数 --property nameacquireRetryAttempts value2//bean配置SqlSessionFactory对象 bean idsqlSessionFactory classorg.mybatis.spring.SqlSessionFactoryBean 注入数据库连接池 property namedataSource refdataSource/配置MyBaties全局配置文件:mybatis-config.xml property nameconfigLocation valueclasspath:mybatis-config.xml/ !-- 3.配置SqlSessionFactory对象 --bean idsqlSessionFactory classorg.mybatis.spring.SqlSessionFactoryBean!-- 注入数据库连接池 --property namedataSource refdataSource/!-- 配置MyBaties全局配置文件:mybatis-config.xml --property nameconfigLocation valueclasspath:mybatis-config.xml//bean配置扫描Dao接口包动态实现Dao接口注入到spring容器中 bean classorg.mybatis.spring.mapper.MapperScannerConfigurer!-- 注入sqlSessionFactory --property namesqlSessionFactoryBeanName valuesqlSessionFactory/!-- 给出需要扫描Dao接口包 --property namebasePackage valuecom.dao//bean ?xml version1.0 encodingUTF-8? web-app xmlnshttp://xmlns.jcp.org/xml/ns/javaeexmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsdversion4.0!--DispatcherServlet--servletservlet-nameDispatcherServlet/servlet-nameservlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-classinit-paramparam-namecontextConfigLocation/param-nameparam-valueclasspath:applicationContext.xml/param-value/init-paramload-on-startup1/load-on-startup/servletservlet-mappingservlet-nameDispatcherServlet/servlet-nameurl-pattern//url-pattern/servlet-mapping!--encodingFilter--filterfilter-nameencodingFilter/filter-namefilter-classorg.springframework.web.filter.CharacterEncodingFilter/filter-classinit-paramparam-nameencoding/param-nameparam-valueutf-8/param-value/init-param/filterfilter-mappingfilter-nameencodingFilter/filter-nameurl-pattern/*/url-pattern/filter-mapping!--Session过期时间--session-configsession-timeout15/session-timeout/session-config/web-appspring-mvc.xml ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxmlns:mvchttp://www.springframework.org/schema/mvcxsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd!-- 配置SpringMVC --!-- 1.开启SpringMVC注解驱动 --mvc:annotation-driven/!-- 2.静态资源默认servlet配置--mvc:default-servlet-handler/!-- 3.配置jsp 显示ViewResolver视图解析器 --bean classorg.springframework.web.servlet.view.InternalResourceViewResolverproperty nameviewClass valueorg.springframework.web.servlet.view.JstlView/property nameprefix value/WEB-INF/jsp//property namesuffix value.jsp//bean!-- 4.扫描web相关的bean --context:component-scan base-packagecom.controller / /beans​
http://www.hkea.cn/news/14398233/

相关文章:

  • 网站建设分工说明网站建设公司的经营范围
  • 用墨刀做网站后台原型网站设计的尺寸
  • 临沂网站建设培训域名如何做网站
  • 建个外国网站eyoucms去版权
  • 网站续费模板申请注册公司费用
  • 安徽鸿顺鑫城建设集团网站校园网站建设培训体会
  • 土特产直营网站建设代码网站的主机
  • 网站策划书案例app和网站开发哪个难
  • 现在的网站开发都用什么开发wordpress导航分类插件
  • 自助建站整站源码四川成都广告公司
  • 网站怎么添加管理员湛江网站建设策划
  • title 株洲网站建设网站打不开别人能打开
  • 北京大型网站建设公司wordpress 主题原理
  • 深圳哪些设计公司做网站比较出名三亚网
  • 学校网站建设规划东莞建网站哪家好
  • 网站地址跟网页地址区别商城网站的psd模板免费下载
  • 网站制作多少费用免费做产品宣传的网站
  • 工会网站升级改造建设方案上海阳性增多
  • 网站搜索引擎引流韶关建设局网站
  • g2g有哪些网站聊城专业网站建设公司
  • 深圳住房建设局网站在线做ppt模板下载网站有哪些
  • 电子商务网站建设课程的心得大连开发网站建设
  • 网上有免费的网站吗网络推广怎么入门
  • 浙江城乡建设部网站首页什么网站程序好
  • 龙岩网站设计怎么注册一个自己的平台
  • 网站建设的团队分工网站流量 盈利
  • 陕西网站开发公司fullpage网站
  • 网站建设汽车后市场分析公司注册地址提供
  • 南宁手机网站设计策划网站搭建详细步骤
  • 网站建设利润ps网站首页直线教程