簡體   English   中英

無法通過Apache Tomcat連接到MSSQL DB

[英]Can't connect to MSSQL DB through Apache Tomcat

我正在嘗試設置在Apache Tomcat 8.5.6MSSQL Server 2012, JDK 8, and jdbc 4上運行的Geoportal 1.2.7 我可以登錄到Geoportal,但是轉到“管理”選項卡時,出現錯誤

“發生數據庫通信錯誤”

檢查Apache日志文件,我發現有嚴重錯誤

java.sql.SQLException:無法創建PoolableConnectionFactory(端口號1433:geoportal無效。)

我已經在jdbc的配置中嘗試了一系列不同的條目,但是它總是返回到該錯誤。

<Context docBase="geoportal" path="/geoportal" debug="0" reloadable="true" crossContext="true">
    <Resources
         cachingAllowed="true"
         cacheMaxSize="100000"
     />
    <Resource name="jdbc/gpt" auth="Container" type="javax.sql.DataSource"
              driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
              url="jdbc:sqlserver://SQLDEMOSERVER:1433:geoportal"
              user="******"
              password="*******"  
              maxTotal="20"
              maxIdle="10"
              maxWaitMillis="-1" />
</Context>

那只是我的最新嘗試。 我在網上看到有關URL到底是什么樣的矛盾文章。

我已經嘗試過url="jdbc:sqlserver://SQLDEMOSERVER:1433;databaseName=geoportal" (Geoportal won't launch), url="jdbc:sqlserver://SQLDEMOSERVER:1433/databaseName=geoportal" (Then I get the port error), url="jdbc:sqlserver://SQLDEMOSERVER:1433" (Geoportal won't load).

我機智。 我仔細檢查了其余的配置文件,並且在其中進行的編輯非常少,並且可能對錯誤沒有任何作用。

如果有人指出我的錯誤,將不勝感激。

嘗試

url="jdbc:sqlserver://SQLDEMOSERVER:1433/geoportal

這些URL在SQL Server 2012上對我有用:

jdbc:sqlserver://localhost:1433;databaseName=test
jdbc:sqlserver://localhost:1433;database=test

這不適用於我在SQL Server 2012中,但可能適用於舊版本:

jdbc:sqlserver://localhost:1433/test

這些根本不起作用:

jdbc:sqlserver://localhost:1433/databaseName=test
jdbc:sqlserver://localhost:1433:test

我認為問題出在其他地方(詳細研究“不會啟動”問題)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM