简体   繁体   中英

how to solve connection between DB and Application

Currently I am working on a project using spring, hibernate with Microsoft SQL, in this project there is a part to generate invoice. When I run this part to generate invoice it take around 5 to 15 min then I retrieve invoice List from Db and show it in UI. I got exception after it process for around 7 to 10 min. Note: When I check in Db , invoice is already generated. How can I solve this issue?

The exception as follows:

org.hibernate.exception.JDBCConnectionException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:99)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) 

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 192.168.191.19, port 1433 has failed. Error: "Address already in use: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".

I think the driver may be the problem. Try using jtds driver instead of microsoft dirver.

检查您的连接网址格式。这是示例连接网址格式。

     jdbc:sqlserver://localhost:1433;databaseName=AdventureWorks;integratedSecurity=true;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM