Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to solve the error report of JDBC connection

Shulou Source: shulou.com Published: 2022-06-01 09:36:53 11月16日 Update

This article mainly explains "how to solve the problem of JDBC connection error". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "JDBC connection error report how to solve" it!

The solution is as follows:

1) whether there is a problem with the database itself, there is no problem with the client login.

2) check if there is a problem with the war package, connect to the database locally, no problem.

3) is there something wrong with the startup parameters? Because of multiple data sources, the data source and driver name are configured in the startup parameters.

-- spring.datasource.url=jdbc:dm://172.31.98.190:5236/DMSERVER\

-- spring.datasource.driverClassName=dm.jdbc.driver.DmDriver\

Check it out and there's no problem.

4) are there any special characters?

I looked at the startup script with vi-b start.sh and found no special characters like ^ M.

5) remove the startup parameters, write them into application.properties, repackage them, upload them,. / start.sh, the startup does not report an error.

6) check these two lines of parameters again later, delete the parameters line by line, type them manually, and navigate to the parameter line

-- spring.datasource.driverClassName=dm.jdbc.driver.DmDriver\

Delete the space after DmDriver, and then manually type in the space,: wq save, restart and start successfully.

7) Why? I went to have lunch and come back to see it in the afternoon. Suspected hidden characters on the road.

8) when I came back in the afternoon, I went to Baidu according to the idea of hidden characters to see if there was any other way to view the hidden characters on linux. Found an order, cat-A.

Cat-A start.sh

The information found is as follows

-- spring.datasource.url=jdbc:dm://172.31.98.190:5236/DMSERVERM-BM-\ $

-- spring.datasource.driverClassName=dm.jdbc.driver.DmDriverM-BM-\ $

With the addition of MmurBM-this special string of characters, the truth will be revealed.

9) what special character is MmurBM -? Which god can tell me? My keyword search only found the BM algorithm, which is a search and replacement algorithm. I also found a post saying that this problem also occurred when I posted it in oneNote. Therefore, it is speculated that it is caused by the operation and maintenance personnel replacing the database parameters in batch on windows.

At this point, I believe you have a deeper understanding of "JDBC connection error report how to solve", might as well come to the actual operation! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Parameters characters problems data special database content ideas manual data sources methods spaces algorithms learning checking practical deeper successful truth revealed personnel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Redmi Apple Shulou Technology Docker