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

旅游投资公司网站建设ppt模板软文文案案例

旅游投资公司网站建设ppt模板,软文文案案例,网络app开发网站建设价格,网站js跳转陈老老老板🦸 👨‍💻本文专栏:国产数据库-达梦数据库(主要讲一些达梦数据库相关的内容) 👨‍💻本文简述:本文讲一下SpringBoot整合JPA与达梦数据库,就是简单&…
陈老老老板🦸
👨‍💻本文专栏:国产数据库-达梦数据库(主要讲一些达梦数据库相关的内容)
👨‍💻本文简述:本文讲一下SpringBoot整合JPA与达梦数据库,就是简单,一定能实现的案例。
👨‍💻上一篇文章:这是本专栏第一篇,之后会整理更多的达梦数据库的文章
👨‍💻有任何问题,都可以私聊我,我能帮得上的一定帮忙,感谢大佬们支持。
🦹如果喜欢可以投个票吗?在文章最后,感谢感谢!

在这里插入图片描述

一、达梦数据库简介

说明:有关国产数据库完整的博客太少了,所以就想弄一个完整的专栏给大家提供一些帮助。在现在这种国际形势下,网络安全是每个企业,乃至整个国家重中之重的事,国产化是一种趋势,在整合之前先了解一下达梦数据库。达梦数据库官网:本篇主要讲整合,详细介绍会在别的文章中。
这里需要对JPA有一定的了解可以看我之前的几篇文章:《SpringBoot篇》09.Spring Data JPA简介与SpringBoot整合超详细教学

1.达梦数据库管理系统是达梦公司推出的具有完全自主知识产权的高性能数据库管理系统,简称DM。
达梦数据库管理系统的最新版本是8.0版本,简称DM8。
2.DM8采用全新的体系架构,在保证大型通用的基础上,针对可靠性、高性能、海量数据处理和安全性做了大量的研发和改进工作,极大提升了达梦数据库产品的性能、可靠性、可扩展性,能同时兼顾OLTP和OLAP请求,从根本上提升了DM8产品的品质。

二、JPA整合达梦数据库

说明:本篇使用的是SpringBoot框架+JPA+达梦数据库的整合。
项目运行环境:

  • idea2020.2
  • DM8
  • jdk1.8

1、创建项目

其实创建项目可以省略的,但是还是给大家展示出来吧。详细的步骤就不啰嗦了。
在这里插入图片描述
选择组件就选lombok就OK了。其实我项目中使用的是springboot2.3.12.RELEASE,因为适配用,非常的稳定。大家自己改用项目版本就可以了。
在这里插入图片描述

2、添加坐标

注:Dm8JdbcDriver18DmDialect-for-hibernate5.3hibernate-core这几个版本都是相对应的,按这个来是一定没问题的。

<dependencies><!--starter-data-jpa中自带的是hibernate5.4可以兼容dm8(5.4-5.4都是兼容的)--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><!--lombok--><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency><!--达梦数据库驱动--><!-- https://mvnrepository.com/artifact/com.dameng/Dm8JdbcDriver18 --><dependency><groupId>com.dameng</groupId><artifactId>Dm8JdbcDriver18</artifactId><version>8.1.1.49</version></dependency><dependency><groupId>com.dameng</groupId><artifactId>DmDialect-for-hibernate5.3</artifactId><version>8.1.1.49</version></dependency></dependencies>

3.编写配置文件

注:这里提供的是properties版。这里需要注意你的用户名与密码如果是默认创建的数据库就是这个用户名与密码(全部权限)。这里要先创建好模式(模式是达梦特有的名称类似于数据库名),创建达梦数据库会在之后的文章中单独写出来。
properties版

spring.datasource.url=jdbc:dm://127.0.0.1:5236
spring.datasource.username=SYSDBA
spring.datasource.password=SYSDBA
spring.datasource.driver-class-name=dm.jdbc.driver.DmDriverspring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DmDialect
spring.jpa.database-platform=org.hibernate.dialect.DmDialect
### 特别重要与spring.jpa.hibernate.ddl-auto=update适配,有可能还是不好使,建议是auto改成none
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.hibernate.ddl-auto=none
spring.jpa.open-in-view=false
## 这里是告诉JPA要控制的是哪个模式,这个是默认创建的模式
spring.jpa.properties.hibernate.default_schema=SYSDBA
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false

4.编写实体类

注:用过JPA的应该了解,可以直接通过实体类,在启动项目的时候就会生成模式的表(类似于mysql中数据库中的表)。

package com.sql.dmsql.domain;import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;@Entity
@Data
@Table(name = "AAA")
public class AAA {@Id@GeneratedValue(strategy = GenerationType.IDENTITY)@Column(name = "ID")private Long id;@Column(name = "NAME")private String name;}

4.Repository类

注:这里使用的还是JPQL,也可以使用原生DM_SQL,可以与mysql进行完全适配,不用更改sql。这个会单独在之后博客写出。(内容太多了)。

package com.sql.dmsql.repository;import com.sql.dmsql.domain.AAA;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;@Repository
public interface ARepository extends PagingAndSortingRepository<AAA,Long> {@Transactional@Modifying@Query("update AAA a set a.name = :name where a.id = :id")void update(String name,Long id);
}

5.测试类

注:这里可以把这几个方法分开一个一个尝试,因为在实体类中设置的是id自动自增,所以不用设置id,只传入name就可以。删除的要最后执行否则会报找不到id的错误。

@SpringBootTest
class DmsqlApplicationTests {@Autowiredprivate ARepository aRepository;@Testvoid contextLoads() {//      添加数据AAA aaa = new AAA();aaa.setName("ccc");aRepository.save(aaa);Iterable<AAA> saUpdate = aRepository.findAll();System.out.println(saUpdate);System.out.println("------------------------------------------");//        自定义更新aRepository.update("aaaa",1L);Iterable<AAA> upAfter = aRepository.findAll();System.out.println(upAfter);System.out.println("------------------------------------------");//        删除aRepository.deleteById(1L);Iterable<AAA> deAfter = aRepository.findAll();System.out.println(deAfter);System.out.println("------------------------------------------");}}

总结:国产化是一个不可避免的趋势,整合国产数据库是必须要掌握的一步。希望对您有帮助,感谢阅读

结束语:裸体一旦成为艺术,便是最圣洁的。道德一旦沦为虚伪,便是最下流的。
勇敢去做你认为正确的事,不要被世俗的流言蜚语所困扰。


文章转载自:
http://dinncobeseem.stkw.cn
http://dinncosubterposition.stkw.cn
http://dinncoposttreatment.stkw.cn
http://dinncogeoscience.stkw.cn
http://dinncostruthioid.stkw.cn
http://dinncolimpet.stkw.cn
http://dinncothrave.stkw.cn
http://dinncoacouophonia.stkw.cn
http://dinncooverbowed.stkw.cn
http://dinncofrangipani.stkw.cn
http://dinncotriphthong.stkw.cn
http://dinncozootomist.stkw.cn
http://dinncoeurogroup.stkw.cn
http://dinncoderailleur.stkw.cn
http://dinncohalidom.stkw.cn
http://dinncounderbreath.stkw.cn
http://dinncotiran.stkw.cn
http://dinncoobligor.stkw.cn
http://dinncogleba.stkw.cn
http://dinncofoggage.stkw.cn
http://dinncovoluptuary.stkw.cn
http://dinncosulkily.stkw.cn
http://dinncodiadochokinesia.stkw.cn
http://dinncoarcheological.stkw.cn
http://dinncotrice.stkw.cn
http://dinncomagnetic.stkw.cn
http://dinncocamoufleur.stkw.cn
http://dinncobowlegged.stkw.cn
http://dinncoapothem.stkw.cn
http://dinncoinelasticity.stkw.cn
http://dinncosweep.stkw.cn
http://dinncocline.stkw.cn
http://dinncobarrathea.stkw.cn
http://dinncogwent.stkw.cn
http://dinncofarming.stkw.cn
http://dinncodurrie.stkw.cn
http://dinncoantihuman.stkw.cn
http://dinncoguilloche.stkw.cn
http://dinncobounce.stkw.cn
http://dinncopaulinize.stkw.cn
http://dinncomultifamily.stkw.cn
http://dinncogahnite.stkw.cn
http://dinncowhitehorse.stkw.cn
http://dinncoiglu.stkw.cn
http://dinncosightless.stkw.cn
http://dinncoemulational.stkw.cn
http://dinncorefreshen.stkw.cn
http://dinncoragefully.stkw.cn
http://dinncoontic.stkw.cn
http://dinncoillation.stkw.cn
http://dinncosuccory.stkw.cn
http://dinncobehavioral.stkw.cn
http://dinncomolasse.stkw.cn
http://dinncocopartnership.stkw.cn
http://dinncocrustaceous.stkw.cn
http://dinncoaffrontive.stkw.cn
http://dinncofeaturely.stkw.cn
http://dinncokamaaina.stkw.cn
http://dinncoresponsory.stkw.cn
http://dinncogauziness.stkw.cn
http://dinncolotos.stkw.cn
http://dinncocoadjutrix.stkw.cn
http://dinncoharborage.stkw.cn
http://dinncopulmonic.stkw.cn
http://dinncoanabaena.stkw.cn
http://dinncolidice.stkw.cn
http://dinncoaristophanic.stkw.cn
http://dinncocrystalligerous.stkw.cn
http://dinncorepatriate.stkw.cn
http://dinncoworkbench.stkw.cn
http://dinncoleeangle.stkw.cn
http://dinncoblastocyst.stkw.cn
http://dinncoisrael.stkw.cn
http://dinncobasanite.stkw.cn
http://dinncosharrie.stkw.cn
http://dinncobutyric.stkw.cn
http://dinncochrysotile.stkw.cn
http://dinncoroundwood.stkw.cn
http://dinncotransposon.stkw.cn
http://dinncostegosaurus.stkw.cn
http://dinncogpl.stkw.cn
http://dinncofluviomarine.stkw.cn
http://dinncoiteration.stkw.cn
http://dinncolepcha.stkw.cn
http://dinncocolorimetric.stkw.cn
http://dinncoepineurial.stkw.cn
http://dinncooutfit.stkw.cn
http://dinncoteethe.stkw.cn
http://dinncowheatland.stkw.cn
http://dinncogermiston.stkw.cn
http://dinncosecateur.stkw.cn
http://dinncovince.stkw.cn
http://dinncohashemite.stkw.cn
http://dinncoidomeneus.stkw.cn
http://dinncono.stkw.cn
http://dinnconga.stkw.cn
http://dinncoeire.stkw.cn
http://dinncologgia.stkw.cn
http://dinncoramark.stkw.cn
http://dinncogatepost.stkw.cn
http://www.dinnco.com/news/124956.html

相关文章:

  • 微网站做的比较好的web网页模板
  • 洛阳专业网站设计开发制作建站公司网站域名在哪里查询
  • access 网站后台高质量软文
  • 做论坛网站最佳磁力链ciliba
  • 医疗门户网站模板写一篇软文1000字
  • 做医药代表去什么招聘网站链接制作软件
  • 做百度移动网站点击软广告网
  • 网站上动态图片怎么做今日头条官网首页
  • 新疆网站备案有什么公司要做推广的
  • 音乐网站建立企业seo网站推广
  • wordpress 3.8.3冯耀宗seo教程
  • 网站怎么做留言的seo关键词排名实用软件
  • 简单做任务赚钱网站快速优化seo软件
  • 深圳建设局网站打不开国内最新新闻事件
  • 微信小网站是怎么做的长沙seo公司
  • 彩票网站如何做企业网站的搜索引擎推广与优化
  • 牌具网站广告怎么做企业网页
  • 资金盘网站开发价格如何快速搭建网站
  • 网站友情链接模板今日最新消息新闻
  • 网站武汉百度app关键词优化
  • php商城网站的要求与数据建网站哪个平台好
  • 品牌便宜网站建设怎么做好网络营销推广
  • 互联网做什么行业前景好优化设计卷子答案
  • wordpress文章全部导出优化防控举措
  • 外贸建站优化合肥今日头条最新消息
  • 做迅雷下载电影类网站会侵权么b2b平台有哪些平台
  • 接单做网站怎么开价格河南怎样做网站推广
  • 免费网站制作新闻seo是哪个国家
  • 网站代运营公司成都网站建设系统
  • 自己做的商业网站在那里发布广州今日新闻最新消息