Java. SQL. sqlexception: no suitable driver found for this exception occurs for two reasons:
1. There is no proper database driver in the searchable path.
2. the URL provided during database connection is incorrect.
Generally, the first condition does not often happen, because we do not install drivers when connecting to the database, and the driver path is basically not a problem.
Most of them are incorrect database connection URLs. In this case, the URL, user name, and password are most often read from the configuration file.
Because the data in the configuration file seems to be correct, it may be caused by formatting of the configuration file, which is inconsistent with the data displayed,
In most cases, invisible characters such as carriage return, line breaks, and tabs are added before and after the data.
Solution: 1. Install the correct driver and configure the correct path.
2. Read the database connection URL, user name, and password from the configuration file and perform a special character filter.