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

宁津县建设局网站网站开发的数据库技术

宁津县建设局网站,网站开发的数据库技术,宁波三优互动网站建设公司怎么样,东阳哪里可以做网站SonarQube部署完成后,在浏览器地址栏输入http://IP:9000可以进入登录页面,以本机运行为例,地址为http://127.0.0.1:9000/,默认登录名:admin,登录密码也是admin。登录后会要求设置密码: 按要求设…

SonarQube部署完成后,在浏览器地址栏输入http://IP:9000可以进入登录页面,以本机运行为例,地址为http://127.0.0.1:9000/,默认登录名:admin,登录密码也是admin。登录后会要求设置密码:
修改密码
按要求设置新密码即可,系统要求如下:
pwd requirement
设置后即可登录系统:
index
从图中可见,如果用默认的嵌入式数据库(H2)的话,会有仅作测试用提示:

Embedded database should be used for evaluation purposes only. It doesn’t support scaling, upgrading to a new SonarQube Server version, or migration to another database engine.

插件安装

点击配置、应用市场:“Administration->Marketplace”,可以安装插件,这里我们以“Chinese Pack”中文语言包为例。
plugins
安装后界面变成了中文。此外应用市场Marketplace还有很多插件可以供我们使用,这个可以在使用过程中逐渐探索。安装完成后系统会要求重启(启用插件)或复原(回退):
marketplace restart
点击重启按钮“Restart Server”后,会自动重启服务:
backend
重启后系统需要重新登录:
login
登录后界面变成中文的了:
ch

数据库配置

SonarQube默认是H2数据库,但事实上它支持OraclePostgreSQLMicrosoft SQLServer,四种数据库,通过修改config文件夹下sonar.propertiessonar.jdbc.url属性,可以指向我们要使用的数据库。
整个sonar.properties文件的数据库配置部分摘录如下:

#--------------------------------------------------------------------------------------------------
# DATABASE
#
# IMPORTANT:
# - The embedded H2 database is used by default. It is recommended for tests but not for
#   production use. Supported databases are Oracle, PostgreSQL and Microsoft SQLServer.
# - Changes to database connection URL (sonar.jdbc.url) can affect SonarSource licensed products.# User credentials.
# Permissions to create tables, indices and triggers must be granted to JDBC user.
# The schema must be created first.
#sonar.jdbc.username=
#sonar.jdbc.password=#----- Embedded Database (default)
# H2 embedded database server listening port, defaults to 9092
#sonar.embeddedDatabase.port=9092#----- Oracle 19c/21c
# The Oracle JDBC driver must be copied into the directory extensions/jdbc-driver/oracle/.
# Only the thin client is supported, and we recommend using the latest Oracle JDBC driver. See
# https://jira.sonarsource.com/browse/SONAR-9758 for more details.
# If you need to set the schema, please refer to http://jira.sonarsource.com/browse/SONAR-5000
#sonar.jdbc.url=jdbc:oracle:thin:@localhost:1521/XE#----- PostgreSQL 11 or greater
# By default the schema named "public" is used. It can be overridden with the parameter "currentSchema".
#sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube?currentSchema=my_schema#----- Microsoft SQLServer 2014/2016/2017/2019/2022 and SQL Azure
# A database named sonar must exist and its collation must be case-sensitive (CS) and accent-sensitive (AS)
# Use the following connection string if you want to use integrated security with Microsoft Sql Server
# Do not set sonar.jdbc.username or sonar.jdbc.password property if you are using Integrated Security
# For Integrated Security to work, you have to install the Microsoft SQL JDBC Auth package
# Please refer to the online documentation https://docs.sonarsource.com/sonarqube
# for the exact procedure for this version of SonarQube.
#sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=sonar;integratedSecurity=true# Use the following connection string if you want to use SQL Auth while connecting to MS Sql Server.
# Set the sonar.jdbc.username and sonar.jdbc.password appropriately.
#sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=sonar#----- Connection pool settings
# The maximum number of active connections that can be allocated
# at the same time, or negative for no limit.
# The recommended value is 1.2 * max sizes of HTTP pools. For example if HTTP ports are
# enabled with default sizes (50, see property sonar.web.http.maxThreads)
# then sonar.jdbc.maxActive should be 1.2 * 50 = 60.
#sonar.jdbc.maxActive=60# The minimum number of connections that can remain idle in the pool,
# without extra ones being created, or zero to create none.
#sonar.jdbc.minIdle=10# The maximum number of milliseconds that the pool will wait (when there
# are no available connections) for a connection to be returned before
# throwing an exception, or <= 0 to wait indefinitely.
#sonar.jdbc.maxWait=8000

1. 支持的数据库
参考官方文档(Database requirements | SonarQube Community Build Documentation)及前述,我们可以看出,SonarQube支持以下数据库引擎:

数据库引擎安装要求
PostgreSQL版本:13-17(官方文档要求,实际上看配置文件,支持版本11及以上)
Microsoft SQLServer

官方文档版本要求:

2022 (MSSQL Server 16.0); 2019 (MSSQL Server 15.0); 2017 (MSSQL Server 14.0); 2016 (MSSQL Server 13.0),需要Micorsoft JDBC驱动(SonarQubelib目录已包含)

配置文件实际版本要求:

Microsoft SQLServer 2014/2016/2017/2019/2022 and SQL Azure

注:

  • 支持SQL Server Express版本
  • 支持WindowsSQL Server两种身份验证方式

Oracle

版本要求:23ai, 21C, 19C, XE Editions

推荐:最新版本的 Oracle JDBC驱动

注:

  • 不支持odbc14.jar驱动
  • 只支持thin模式,不支持OCI
  • 只支持MAX_STRING_SIZE=STANDARD参数,不支持EXTENDED
  • Oracle JDBC 驱动12.1.0.112.1.0.2有较大bug不推荐应用在SonarQube社区版中(点击可查看详情)

2. 修改数据库连接
Microsoft SQL Server为例,我们尝试对SonarQube连接的数据库进行配置。
(1)数据库创建
create db
ssms
需要注意的是,SonarQube要求大小写和强调差异(case-sensitive and accent-sensitive)敏感的排序规则,如:Chinese_PRC_CS_AS

ALTER DATABASE sonar COLLATE Chinese_PRC_CS_AS

collate
(2)数据库连接修改
根据config/sonar.properties配置文件的说明,修改连接指向后,表结构等内容会自动创建(要求具有相应权限)。
首先,我们设置数据库的用户名和密码:

sonar.jdbc.username=your_db_user
sonar.jdbc.password=your_db_password

接着,我们修改数据库连接字符串,对于SQL Server,其配置参考如下:

#----- Microsoft SQLServer 2014/2016/2017/2019/2022 and SQL Azure
# A database named sonar must exist and its collation must be case-sensitive (CS) and accent-sensitive (AS)
# Use the following connection string if you want to use integrated security with Microsoft Sql Server
# Do not set sonar.jdbc.username or sonar.jdbc.password property if you are using Integrated Security
# For Integrated Security to work, you have to install the Microsoft SQL JDBC Auth package
# Please refer to the online documentation https://docs.sonarsource.com/sonarqube
# for the exact procedure for this version of SonarQube.
#sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=sonar;integratedSecurity=true# Use the following connection string if you want to use SQL Auth while connecting to MS Sql Server.
# Set the sonar.jdbc.username and sonar.jdbc.password appropriately.
#sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=sonar

我们可以选择集成安全模式(需要安装配套的包),或使用SQL Server自己的鉴权方式,本例为了简单我们选择后者,考虑本机连接,Encrypt属性设置为truetrustServerCertificate属性设置为true(信任服务器证书,使用自签名证书,否则会报错的):

sonar.jdbc.url=jdbc:sqlserver://localhost;databaseName=sonar;encrypt=true;trustServerCertificate=true

(3)修改后运行效果
重新启动SonarQube服务,我们可以观察到如下变化:
restart sonarqube
1)数据库相关对象自动创建了
db tables
2)密码需要重新设定登录
因为换了数据库,需要重新设置密码并登录。
relogin

从上图也可以看出不再提示测试数据库环境(H2)了。

总结

至此,我本机环境的SonarQube实现了数据库的更改,当然,在实际的应用中使用Docker容器安装Sonar会简便很多,但为了对这个工具有更多了解(踩更多的坑,更改数据库配置过程也遇到一些问题,参见这里),手工操作也是一个不错的体验。
接下来,我将尝试对这个工具做更多的学习、应用与探索。


文章转载自:

http://idzIg440.ztqyj.cn
http://ShbBdKKR.ztqyj.cn
http://furssAeU.ztqyj.cn
http://SrnRD2QX.ztqyj.cn
http://vtuHQSCR.ztqyj.cn
http://KzWFbk4n.ztqyj.cn
http://6FNkt1GA.ztqyj.cn
http://kXM129cK.ztqyj.cn
http://dIfF7X4T.ztqyj.cn
http://IRjl5v57.ztqyj.cn
http://CRdwRGKN.ztqyj.cn
http://Z6wlSrAs.ztqyj.cn
http://PoDFd5ZB.ztqyj.cn
http://P5MSYfdV.ztqyj.cn
http://ykR5SsXd.ztqyj.cn
http://KKopGwJu.ztqyj.cn
http://s8OCGd9h.ztqyj.cn
http://qujfl7CC.ztqyj.cn
http://YmOjtCrq.ztqyj.cn
http://4dBmG1Qv.ztqyj.cn
http://l4PXRNkn.ztqyj.cn
http://yFpaoeug.ztqyj.cn
http://dOxFQVXq.ztqyj.cn
http://KpvntMOH.ztqyj.cn
http://4jBm16pc.ztqyj.cn
http://jVXvXUBR.ztqyj.cn
http://LqT7tSaO.ztqyj.cn
http://tZOOqagk.ztqyj.cn
http://2rGNNB2Q.ztqyj.cn
http://cRx5U1Ju.ztqyj.cn
http://www.dtcms.com/wzjs/755069.html

相关文章:

  • 国家住房和城乡建设局网站首页dw做网站怎么发布
  • 宁波seo整站优化软件小程序开发公司价格表
  • 校园网站建设总体设计网站服务器可以更换吗
  • 武进区建设局网站宁波专业的网站搭建公司
  • 漯河高端网站建设推荐网站建设服务
  • 做家常菜的网站哪个好青岛开发网站
  • 常州建设银行网站林州做网站
  • 潍坊网站制作保定公司电话谷歌seo怎么做
  • 做微信公众号的网站wordpress 中文在线留言
  • 酷站 网站模板免费营销网站制作
  • 网站单个页面外链网
  • 网站开发人员配置给网站做游戏视频怎么赚钱
  • 超酷个人网站欣赏微信网站建设报价单
  • 网站建设单子百度推广 帮做网站吗
  • pc优化工具搜索引擎优化答案
  • 用mvc做网站的框架织梦做的网站页面打不开
  • 公司用员工信息做网站域名备案网站开发与服务合同
  • 网上做兼职做网站老年公寓网站模板
  • 做优秀网站简历模板免费下载电子版
  • 福田建设大型网站建设公司好吗一个网站可以做几级链接
  • 北京免费网站设计wordpress代码编辑器
  • 海口网站提升排名idea网站开发教程
  • 苏州前几天网站建设自己做的网站怎么发布到网上
  • 试百客 专业做试用的网站母婴网站模板dede
  • 手机平台网站系统wordpress自定义二级菜单
  • 做301重定向会影响网站权重吗周口网站建设
  • 域名还没备案可以做网站吗可以自建网站吗
  • 网站关键字分析平面设计培训多少钱 贵吗
  • 昆山做网站企业传统网站开发实例
  • 手机网站网页开发教程青岛企业网站开发