gpt4 book ai didi

java - 如何修复 : No suitable driver found for sqlserver://localhost:1433;DatabaseName=XX

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:47:13 26 4
gpt4 key购买 nike

由于这个数据库错误,我有一个巨大的 Java 项目无法运行

APPLICATION STARTUP FAILURE No suitable driver found for sqlserver://localhost:1433;DatabaseName=XX java.sql.SQLException: No suitable driver found for sqlserver://localhost:1433;DatabaseName=XX at java.sql.DriverManager.getConnection(DriverManager.java:602) at java.sql.DriverManager.getConnection(DriverManager.java:185) at artemispm.serverutil.ConnectionPool.newConnection(ConnectionPool.java:577) at artemispm.serverutil.ConnectionPool.manageConnections(ConnectionPool.java:470) at artemispm.serverutil.ConnectionPool.getPooledConnection(ConnectionPool.java:421) at artemispm.serverutil.ConnectionPool.getConnection(ConnectionPool.java:355) at artemispm.serverutil.ConnectionPool.getConnection(ConnectionPool.java:329) at artemispm.serverutil.AppMgr.getConnection(AppMgr.java:492) at artemispm.trjdbc.TRJConnection.(TRJConnection.java:46) at artemispm.trdo.TRBaseSql.getConnection(TRBaseSql.java:2903) at artemispm.service.TRDebugWriter.transmit(TRDebugWriter.java:105) at artemispm.trapplets.DataBroker.clockedTransmit(DataBroker.java:4969) at artemispm.trapplets.DataBroker.callService(DataBroker.java:3125) at artemispm.trapplets.DataBroker.callService(DataBroker.java:3103) at artemispm.trapplets.DataBroker.initTriton(DataBroker.java:325) at artemispm.trapplets.TRApplet.init(TRApplet.java:296) at sun.applet.AppletPanel.run(AppletPanel.java:425) at java.lang.Thread.run(Thread.java:662)

Build Version:?VERSION? productpm.trdo.TRSeriousException: No suitable driver found for sqlserver://localhost:1433;DatabaseName=XX at artemispm.trapplets.DataBroker.checkError(DataBroker.java:659) at artemispm.trapplets.DataBroker.callService(DataBroker.java:3129) at artemispm.trapplets.DataBroker.callService(DataBroker.java:3103) at artemispm.trapplets.DataBroker.initTriton(DataBroker.java:325) at artemispm.trapplets.TRApplet.init(TRApplet.java:296) at sun.applet.AppletPanel.run(AppletPanel.java:425) at java.lang.Thread.run(Thread.java:662)

我试着放置sqljdbc.jarsqljdbc4.jar在 %catalina_home&\lib 文件夹中,但这没有帮助

我不熟悉 Java,但希望得到任何帮助。

编辑:我的连接字符串在 customer.properties 文件中定义如下:APP.url= sqlserver://localhost:1433;DatabaseName=XX

现在我把它改成了:APP.url= jdbc:sqlserver://localhost:1433;DatabaseName=XX

我有新的错误:

APPLICATION STARTUP FAILURE Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.

如何切换到新驱动程序?

最佳答案

您的 URL 应该是 jdbc:sqlserver://server:port;DatabaseName=dbname

您确定输入正确吗?

关于java - 如何修复 : No suitable driver found for sqlserver://localhost:1433;DatabaseName=XX,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20447545/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com