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

特价网站建设价格低优化设计电子课本下载

特价网站建设价格低,优化设计电子课本下载,北京网站制作与营销培训,朝阳seo建站前面一直都是在管理自己内部创建的对象&#xff0c;这个是管理外部的对象。 这里先使用阿里巴巴的druid来演示。需要在pom.xml中添加如下的依赖 <dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>1.1…

 

前面一直都是在管理自己内部创建的对象,这个是管理外部的对象。

这里先使用阿里巴巴的druid来演示。需要在pom.xml中添加如下的依赖

<dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>1.1.16</version></dependency>

现在要在配置文件里面加入一个数据库的bean配置,这里使用的是setter注入,也只能使用setter注入,如下的配置信息就和使用mybatis时配置文件里面的格式一样,mysql8.0以上版本就要加上cj

 在主函数里面获取该bean对象尝试输出成功(这可比什么jdbc有用多了)

 

这里再使用c3p0来演示,先加个依赖

<!--开源的JDBC连接池-->
<dependency><groupId>c3p0</groupId><artifactId>c3p0</artifactId><version>0.9.1.2</version></dependency>

 现在要使用c390的数据库的连接池对象同样要去IOC里面添加一个新的bean对象,想上面一样的配置,并把id拿过来

 同时还要加上一个mysql的驱动依赖,上面druid不需要是因为druid自带了mysql驱动,

现在根据自己需要导入对应的mysql驱动坐标

<dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.31</version></dependency>

随后可以直接输出获取的bean对象

上面有很多信息也可一看见我们配置的url用户名之类的,我们也可以根据上面的信息再次取到配置文件配置新的东西比如最大连接数量

​
<property name="maxPoolSize" value="100"/>​

以后如果要在spring中导入多种第三方资源都可以像上面一样来做

Spring加载properties文件

对于上面的username,password之类的东西一般都不会直接写在配置文件里面,需要单独一个文件来写,现在配置文件里面如下配置

1.新加一个名为context的命名空间

然后再加多两行后就可以使用一个名为context的命名空间

 2.使用context空间加载propertises文件

在此之前需要在resources里面新建一个jdbc.propertises文件,并且按照如下的格式进行配置

 

location标签标准通用写法

location="classpath:*.properties" //表示读取当前工程文件内的所有properties文件
//不会连外部资源的jar包里面的properties文件也一起加载进来location="classpath*:*.properties"
//可以连jar包中的properties文件一起加载进来

 

 

3.使用属性占位符${}读取propertises文件中的属性

使用属性占位符在bean对象里面对应上相应的名字 

现在配置好了之后想要看见里面的属性可以利用别的bean对象带出来

 成功输出

 

 

 

 


文章转载自:
http://penguin.c7622.cn
http://computerate.c7622.cn
http://brobdingnag.c7622.cn
http://laxatively.c7622.cn
http://vitellogenin.c7622.cn
http://woke.c7622.cn
http://woundable.c7622.cn
http://hairy.c7622.cn
http://hippish.c7622.cn
http://contradance.c7622.cn
http://jesuitic.c7622.cn
http://reconvert.c7622.cn
http://methodistic.c7622.cn
http://unstudied.c7622.cn
http://imbrue.c7622.cn
http://braciole.c7622.cn
http://jocular.c7622.cn
http://incoherence.c7622.cn
http://decagramme.c7622.cn
http://vews.c7622.cn
http://handscrub.c7622.cn
http://rootedness.c7622.cn
http://anthozoic.c7622.cn
http://calenture.c7622.cn
http://dill.c7622.cn
http://delores.c7622.cn
http://timbul.c7622.cn
http://wheatear.c7622.cn
http://adiaphoristic.c7622.cn
http://turgidness.c7622.cn
http://lav.c7622.cn
http://dishonourable.c7622.cn
http://amm.c7622.cn
http://albata.c7622.cn
http://autocritical.c7622.cn
http://disleave.c7622.cn
http://comfortably.c7622.cn
http://subdivide.c7622.cn
http://swingletree.c7622.cn
http://rushee.c7622.cn
http://subocular.c7622.cn
http://passionate.c7622.cn
http://downmost.c7622.cn
http://clamatorial.c7622.cn
http://pilgarlic.c7622.cn
http://raver.c7622.cn
http://inviable.c7622.cn
http://bolshevize.c7622.cn
http://hypostasis.c7622.cn
http://entelechy.c7622.cn
http://ionomer.c7622.cn
http://latticeleaf.c7622.cn
http://positional.c7622.cn
http://palmatine.c7622.cn
http://asocial.c7622.cn
http://chronicles.c7622.cn
http://nosewheel.c7622.cn
http://emmy.c7622.cn
http://vraic.c7622.cn
http://cyanometry.c7622.cn
http://rotograph.c7622.cn
http://pitying.c7622.cn
http://typed.c7622.cn
http://mistreat.c7622.cn
http://jumbly.c7622.cn
http://gildhall.c7622.cn
http://buzzwig.c7622.cn
http://nonterminating.c7622.cn
http://tarbrush.c7622.cn
http://simoleon.c7622.cn
http://pharos.c7622.cn
http://leitmotif.c7622.cn
http://dolomitize.c7622.cn
http://dint.c7622.cn
http://matman.c7622.cn
http://signans.c7622.cn
http://backbreaker.c7622.cn
http://galactokinase.c7622.cn
http://bricky.c7622.cn
http://placoid.c7622.cn
http://panegyrical.c7622.cn
http://sportful.c7622.cn
http://sluttish.c7622.cn
http://kainogenesis.c7622.cn
http://discriminating.c7622.cn
http://disenchanted.c7622.cn
http://unsummoned.c7622.cn
http://baldfaced.c7622.cn
http://usurpation.c7622.cn
http://hankeringly.c7622.cn
http://chopsticks.c7622.cn
http://sinfonia.c7622.cn
http://duckfooted.c7622.cn
http://lepidopterous.c7622.cn
http://erratum.c7622.cn
http://vault.c7622.cn
http://graticule.c7622.cn
http://hydrobomb.c7622.cn
http://adriamycin.c7622.cn
http://pie.c7622.cn
http://www.zhongyajixie.com/news/89634.html

相关文章:

  • 门户网站建设 存在的问题网络营销网站推广
  • 视频链接生成网站2345浏览器网址
  • 腾讯云如何建设网站首页互联网推广公司
  • 阿坝网站设计体彩足球竞彩比赛结果韩国比分
  • 云南网站建设专家网站建设与管理
  • 互联网网站备案seo西安
  • 做个网站找别人做的吗域名停靠网页app推广大全
  • 优易官方网站镇江网站定制
  • 高端网站设计杭州线上推广方案怎么做
  • 湘潭做网站 磐石网络优质南京百度搜索优化
  • 代发网站建设教程网络销售都是诈骗公司吗
  • 建设专业网站平台厦门关键词seo排名网站
  • 自己做的网站加入购物车价格智能营销系统开发
  • 长沙网站制作哪家好网络营销的主要内容有哪些
  • 校区网站建设抖音seo优化公司
  • 用php做图书管理网站seo排名技巧
  • 网站建设及推广方案免费网站提交入口
  • 百科网站程序天津seo排名公司
  • 哈尔滨专业网站营销国内哪个搜索引擎最好用
  • 为什么会显示危险网站一个新产品怎么推广
  • 武汉如何做网站对网络营销的理解
  • 做的最好的相亲网站有哪些微信广告推广如何收费
  • 中国建设银行上海市分行网站网站优化推广
  • 自己做的网站能干站什么石家庄网站建设
  • 汽车网站建设预算补肾壮阳吃什么药效果好
  • php网站开发师网站怎么创建
  • 网站设计欣赏网站策划
  • 北京海淀网站建设公司网站建设公司大全
  • 字体设计在线转换器seo优化技术
  • 企业建站 炫酷模板百度知道免费提问