mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-07 01:18:33 +08:00
数据库配置不再强制要求单独存放数据库名称
This commit is contained in:
parent
a7fdb952bc
commit
fbdb456dca
@ -46,8 +46,13 @@ public class JDBCTool {
|
||||
*/
|
||||
public Connection getConn() {
|
||||
Connection connection;
|
||||
String url;
|
||||
try {
|
||||
String url = config.getUrl() + "/" + config.getDatabaseName();
|
||||
if (config.getDatabaseName().isEmpty()){
|
||||
url = config.getUrl();
|
||||
}else{
|
||||
url = config.getUrl() + "/" + config.getDatabaseName();
|
||||
}
|
||||
connection = DriverManager.getConnection(url, config.getUsername(), config.getPassword());
|
||||
} catch (SQLException e) {
|
||||
throw new SmsSqlException(e.getMessage());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user