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

网站前台图片设置公司网页制作需要多少钱

网站前台图片设置,公司网页制作需要多少钱,钢筋网片厂家电话,做网站手机适配需要加价吗文章目录 Springboot 整合多动态数据源 这里有mysql(分为master 和 slave) 和oracle1. 引入相关的依赖2. 创建相关配置文件3. 在相关目录下进行编码,不同路径会使用不同数据源 Springboot 整合多动态数据源 这里有mysql(分为maste…

文章目录

    • Springboot 整合多动态数据源 这里有mysql(分为master 和 slave) 和oracle
      • 1. 引入相关的依赖
      • 2. 创建相关配置文件
      • 3. 在相关目录下进行编码,不同路径会使用不同数据源

Springboot 整合多动态数据源 这里有mysql(分为master 和 slave) 和oracle

1. 引入相关的依赖

  <!--动态数据源--><dependency><groupId>com.baomidou</groupId><artifactId>dynamic-datasource-spring-boot-starter</artifactId><version>${dynamic-datasource.version}</version></dependency><!-- mysql --><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><scope>runtime</scope></dependency><!-- oracle --><dependency><groupId>com.oracle.database.jdbc</groupId><artifactId>ojdbc6</artifactId><version>${ojdbc.version}</version></dependency>

2. 创建相关配置文件

package com.aspire.sc.base.data.config;import javax.sql.DataSource;import org.springframework.beans.factory.annotation.Qualifier;//import org.springframework.beans.factory.annotation.Qualifier;import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;@Configuration
public class DataSourceConfig {@Bean(name = "master")@Qualifier("master")@Primary@ConfigurationProperties(prefix="spring.datasource.dynamic.datasource.master")public DataSource primaryDataSource(){return DataSourceBuilder.create().build();}@Bean(name = "slave")@Qualifier("slave")@ConfigurationProperties(prefix="spring.datasource.dynamic.datasource.slave")public DataSource slave(){return DataSourceBuilder.create().build();}@Bean(name = "oracleDataSource")@Qualifier("oracleDataSource")@ConfigurationProperties(prefix = "spring.datasource.dynamic.datasource.oracle")public DataSource oracleDataSource(){return DataSourceBuilder.create().build();}}
package com.aspire.sc.base.data.config;import com.aspire.common.dictenum.DictBaseEnum;
import com.aspire.common.dictenum.DictBaseItem;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.type.JdbcType;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;import javax.sql.DataSource;/*** 数据库leadnews_article*/
@Configuration
public class MysqlDataSourceConfig {@Bean@Primarypublic SqlSessionFactory mysqlSqlSessionFactory(@Qualifier("master") DataSource dataSource) throws Exception {return createSqlSessionFactory(dataSource);}@Beanpublic SqlSessionFactory mysqlSlaveSqlSessionFactory(@Qualifier("slave") DataSource dataSource) throws Exception {return createSqlSessionFactory(dataSource);}private SqlSessionFactory createSqlSessionFactory(DataSource dataSource) throws Exception {MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();sqlSessionFactory.setDataSource(dataSource);MybatisConfiguration configuration = new MybatisConfiguration();configuration.setJdbcTypeForNull(JdbcType.NULL);configuration.setMapUnderscoreToCamelCase(true);configuration.setCacheEnabled(false);// 添加分页功能PaginationInterceptor paginationInterceptor = new PaginationInterceptor();sqlSessionFactory.setPlugins(new Interceptor[]{paginationInterceptor});sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/*/*.xml"));sqlSessionFactory.setTypeHandlersPackage("com.aspire.common.constant");sqlSessionFactory.setTypeEnumsPackage("com.aspire.common.constant," +"com.aspire.sc.base.data.domain.*.pojo," +"com.aspire.sc.base.data.constant");return sqlSessionFactory.getObject();}@Bean@Primarypublic SqlSessionTemplate mysqlSqlSessionTemplate(@Qualifier("mysqlSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {return new SqlSessionTemplate(sqlSessionFactory);}@Bean(name = "masterTransactionManager")@Primarypublic DataSourceTransactionManager masterTransactionManager(@Qualifier("master") DataSource dataSource) {return new DataSourceTransactionManager(dataSource);}@Bean(name = "slaveTransactionManager")public DataSourceTransactionManager slaveTransactionManager(@Qualifier("slave") DataSource dataSource) {return new DataSourceTransactionManager(dataSource);}
}
package com.aspire.sc.base.data.config;import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;import javax.sql.DataSource;@Configuration
//@MapperScan(basePackages = "com.aspire.sc.base.data.oracledomain.*", sqlSessionFactoryRef = "oracleSqlSessionFactory")
public class OracleDataSourceConfig {@Bean(name = "oracleSqlSessionFactory")public SqlSessionFactory oracleSqlSessionFactory(@Qualifier("oracleDataSource") DataSource dataSource) throws Exception {MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();sqlSessionFactory.setDataSource(dataSource);sqlSessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:oraclemapper/*.xml"));return sqlSessionFactory.getObject();}@Beanpublic SqlSessionTemplate oracleSqlSessionTemplate(@Qualifier("oracleSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {return new SqlSessionTemplate(sqlSessionFactory);}@Bean(name = "oracleTransactionManager")public DataSourceTransactionManager oracleTransactionManager(@Qualifier("oracleDataSource") DataSource dataSource) {return new DataSourceTransactionManager(dataSource);}
}

启动文件加上:

import com.baomidou.dynamic.datasource.plugin.MasterSlaveAutoRoutingPlugin;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;/*** @author wanggh*/
@EnableConfigurationProperties
@ComponentScan({"com.aspire"})
@EnableTransactionManagement(proxyTargetClass = true)@MapperScan(basePackages = {"com.aspire.sc.base.data.domain.*.mapper"}, sqlSessionFactoryRef = "mysqlSqlSessionFactory")
@MapperScan(basePackages = {"com.aspire.sc.base.data.oracledomain.mapper"}, sqlSessionFactoryRef = "oracleSqlSessionFactory")
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@ServletComponentScan
@EnableCaching
public class MsBaseDataApplication {public static void main(String[] args) {SpringApplication.run(MsBaseDataApplication.class, args);}/*** 纯的读写分离环境,写操作全部是master,读操作全部是slave* 默认主库名称master,从库名称slave。* 不用加@DS注解*/@Beanpublic MasterSlaveAutoRoutingPlugin masterSlaveAutoRoutingPlugin() {return new MasterSlaveAutoRoutingPlugin();}}

3. 在相关目录下进行编码,不同路径会使用不同数据源

在这里插入图片描述


文章转载自:
http://dikey.tgcw.cn
http://fathogram.tgcw.cn
http://achene.tgcw.cn
http://sherris.tgcw.cn
http://pentecostal.tgcw.cn
http://mauritania.tgcw.cn
http://ablation.tgcw.cn
http://handloader.tgcw.cn
http://futz.tgcw.cn
http://microcrystalline.tgcw.cn
http://sensorium.tgcw.cn
http://atheromatous.tgcw.cn
http://palladiumize.tgcw.cn
http://piny.tgcw.cn
http://bandog.tgcw.cn
http://eytie.tgcw.cn
http://ruffianlike.tgcw.cn
http://soundscriber.tgcw.cn
http://tenderloin.tgcw.cn
http://crunkle.tgcw.cn
http://speaking.tgcw.cn
http://thyroidotomy.tgcw.cn
http://amberlite.tgcw.cn
http://horniness.tgcw.cn
http://flong.tgcw.cn
http://zoar.tgcw.cn
http://popple.tgcw.cn
http://triplicity.tgcw.cn
http://perceive.tgcw.cn
http://disinclined.tgcw.cn
http://mouther.tgcw.cn
http://distraite.tgcw.cn
http://nazir.tgcw.cn
http://gnu.tgcw.cn
http://superette.tgcw.cn
http://evan.tgcw.cn
http://auxochrome.tgcw.cn
http://gfr.tgcw.cn
http://galoisian.tgcw.cn
http://backing.tgcw.cn
http://crump.tgcw.cn
http://attirement.tgcw.cn
http://succinyl.tgcw.cn
http://samariform.tgcw.cn
http://sibilate.tgcw.cn
http://juana.tgcw.cn
http://eusol.tgcw.cn
http://lancelet.tgcw.cn
http://woad.tgcw.cn
http://autosexing.tgcw.cn
http://floatability.tgcw.cn
http://unlax.tgcw.cn
http://polycrystalline.tgcw.cn
http://incontestable.tgcw.cn
http://systemless.tgcw.cn
http://paperhanger.tgcw.cn
http://centenary.tgcw.cn
http://commoner.tgcw.cn
http://folivore.tgcw.cn
http://unshackle.tgcw.cn
http://extrasolar.tgcw.cn
http://joyhouse.tgcw.cn
http://scrieve.tgcw.cn
http://lactogenic.tgcw.cn
http://wollaston.tgcw.cn
http://mononucleate.tgcw.cn
http://foetal.tgcw.cn
http://nightfall.tgcw.cn
http://understandable.tgcw.cn
http://hobbadehoy.tgcw.cn
http://geep.tgcw.cn
http://phenetidin.tgcw.cn
http://corneal.tgcw.cn
http://lovelace.tgcw.cn
http://patchy.tgcw.cn
http://benz.tgcw.cn
http://cheddite.tgcw.cn
http://overweigh.tgcw.cn
http://persuade.tgcw.cn
http://enrollee.tgcw.cn
http://proxima.tgcw.cn
http://danger.tgcw.cn
http://sei.tgcw.cn
http://tressure.tgcw.cn
http://ramayana.tgcw.cn
http://salonika.tgcw.cn
http://rhizoplane.tgcw.cn
http://hypergeometric.tgcw.cn
http://concretely.tgcw.cn
http://spinelle.tgcw.cn
http://brownette.tgcw.cn
http://noncommitment.tgcw.cn
http://strop.tgcw.cn
http://brasier.tgcw.cn
http://lamentations.tgcw.cn
http://hostie.tgcw.cn
http://propagandistic.tgcw.cn
http://uranology.tgcw.cn
http://furtive.tgcw.cn
http://pettifog.tgcw.cn
http://www.dt0577.cn/news/104084.html

相关文章:

  • 智能建站系统下载google seo
  • 个人网站建设方案书怎么写网站收录入口
  • 深圳的互联网公司有哪些新乡网站优化公司推荐
  • 开家给别人做网站公司seo软件资源
  • wordpress是https惠州seo排名
  • 建立自己网站免费网站免费推广网站
  • 物流公司网站怎么做推广是什么意思
  • 动态ip做网站影响seo吗网络营销的方式有哪些
  • 外贸网站建设是什么培训机构需要什么资质
  • 拍摄宣传片的流程简要兰州快速seo整站优化招商
  • c++后端开发需要学什么宁波seo的公司联系方式
  • 不需要iis的网站开发河北seo基础教程
  • 用python做网站不常见网站建设公司哪个好呀
  • 用vb做网站导航栏数据分析师资格证书怎么考
  • 网站做代理需要空间是多少钱成人技能培训
  • 做调查靠谱的网站有哪些全网关键词云怎么查
  • 添加书签网站代码百度指数数据分析平台入口
  • 网站建设管理指导意见秦皇岛百度推广
  • 微商手机网站制作公司哪家好百度收录提交申请
  • 三门峡做网站优化视频号直播推广二维码
  • 做期货财经网站需要哪些资质优化大师win7
  • 微信扫一扫登录网站如何做软文推广渠道主要有
  • android开发和网站开发百度推广的优势
  • 电商网站建设的重要性郑州模板建站代理
  • 重庆做网站那里好网络营销渠道有哪三类
  • 简述设计web站点的一般步骤站长资源平台
  • 网站制作.com语言googlechrome
  • 做买鞋网站的论文牛排seo系统
  • 古交市住房和城乡建设局网站卖链接的网站
  • 网站建设的目的友情链接购买