问题描述
启动Sonar(StartSonar.bat)时,在日志文件中出现以下错误.
When I start Sonar (StartSonar.bat), I get the following error in the log file.
在SQL Server Management Studio中查看列为nvarchar(max)
Looking at the column in SQL Server Management Studio it is nvarchar(max)
我正在跑步:
- 数据库:SQL Server 2005
- 操作系统:Windows 7 64位
- 声纳:2.11
尝试了以下驱动程序:
- sqljdbc-1.2.2828.100.jar
- sqljdbc4.jar(Microsoft SQL Server JDBC驱动程序2.0)
- sqljdbc4.jar(Microsoft SQL Server JDBC驱动程序3.0)
- sqljdbc4.jar(Microsoft SQL Server JDBC驱动程序4.0)
我的MSSQL属性:
- sonar.jdbc.url:jdbc:sqlserver://localhost; databaseName = SONAR;
- sonar.jdbc.driverClassName:com.microsoft.sqlserver.jdbc.SQLServerDriver
- sonar.jdbc.validationQuery:选择1
- sonar.jdbc.dialect:mssql
我正在使用用户名和密码(SQL身份验证)连接数据库
I'm using a user name and password (SQL Authentication) to connect the DB
自我注意事项:尝试连接到MSSQL时,请记住启用TCP/IP.在SQL Sever配置管理器,SQL Server 2005网络配置,MSSQLSERVER协议,TCP/IP中可以找到
Note to self: When trying to connect to MSSQL remember to Enable TCP/IP. This is found in the SQL Sever Configuration Manager;SQL Server 2005 Network Configuration;Protocols for MSSQLSERVER;TCP/IP
我认为这可能是驱动程序问题,但我不确定
I thought it might be a driver issue, but I'm not sure
还有其他人看到吗?
推荐答案
我无法通过sqljdbc驱动程序解决此问题,因此我从另一篇文章中获得了一些建议,并转而使用jTDS驱动程序 http://jtds.sourceforge.net/index.html
I wasn't able to solve this via the sqljdbc drivers so I took some advise from another post and fell back to the jTDS driver http://jtds.sourceforge.net/index.html
我使用的帖子是声纳MsSql数据库问题
我的设置:
- 声纳2.11解压缩到C:\ Sonar \ sonar-2.11
我所做的步骤(解释为
- 从 jTDS驱动程序下载jTDS驱动程序将其解压缩到某个位置,建议使用C:\ jDST
- 将DLL添加到系统路径. (C:\ jDST \ jtds-1.2.5-dist \ x64 \ SSO)
- 将jar文件(C:\ jDST \ jtds-1.2.5-dist \ jtds-1.2.5.jar)复制到扩展文件夹(C:\ Sonar \ sonar-2.11 \ extensions \ jdbc-driver \ mssql)
-
更新sonar.properties
- Download jTDS drivers from jTDS Drivers Unzip it somewhere, I suggest C:\jDST
- Add the DLL to the system path. (C:\jDST\jtds-1.2.5-dist\x64\SSO)
- Copy the jar file (C:\jDST\jtds-1.2.5-dist\jtds-1.2.5.jar) to the extensions folder(C:\Sonar\sonar-2.11\extensions\jdbc-driver\mssql)
Update the sonar.properties
- sonar.jdbc.url:jdbc:jtds:sqlserver://localhost:1433/SONAR
- sonar.jdbc.driverClassName:net.sourceforge.jtds.jdbc.Driver
- sonar.jdbc.validationQuery:选择1
- sonar.jdbc.dialect:mssql
注意:如果您连接到命名实例,则必须在连接URL中明确指定:jdbc:jtds:sqlserver://localhost/SONAR;instance=SQLEXPRESS
Note: in case you connect to the named instance, this must be specified explicitly in the connection URL: jdbc:jtds:sqlserver://localhost/SONAR;instance=SQLEXPRESS
运行bat文件StartSonar.bat(C:\ Sonar \ sonar-2.11 \ bin \ windows-x86-64 \ StartSonar.bat)
Run the bat file StartSonar.bat (C:\Sonar\sonar-2.11\bin\windows-x86-64\StartSonar.bat)
检查您的日志,然后转到站点http://localhost:9000
Check your logs and go to the site http:// localhost:9000
这篇关于运行连接到SQL Server 2005的Sonar时出错.列说明的SONAR.dbo.rules的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!