diff --git a/README.md b/README.md index e84c9155..21ec336e 100644 --- a/README.md +++ b/README.md @@ -347,8 +347,8 @@ jdbc驱动名称:org.sqlite.JDBC **MongoDB数据库** ``` -jdbc连接地址:jdbc:mongodb://172.17.2.12:27017/test?authSource=admin&authMechanism=SCRAM-SHA-1 -jdbc驱动名称:com.wisecoders.dbschema.mongodb.JdbcDriver +jdbc连接地址:jdbc:mongodb://172.17.2.12:27017/admin?authSource=admin&authMechanism=SCRAM-SHA-1 +jdbc驱动名称:com.gitee.jdbc.mongodb.JdbcDriver ``` #### (2)、启动方法 @@ -591,6 +591,8 @@ service.run(); (5)https://blog.csdn.net/inrgihc/article/details/121447417 +(6)https://blog.csdn.net/inrgihc/article/details/132241613 + ## 七、贡献参与 为了能让项目得到更好的可持续的发展,dbswitch期望获得更多的代码开发爱好者参与代码贡献,具体可参见文档说明:[贡献说明指南](/CONTRIBUTE.md) diff --git a/dbswitch-common/src/main/java/com/gitee/dbswitch/common/util/JdbcUrlUtils.java b/dbswitch-common/src/main/java/com/gitee/dbswitch/common/util/JdbcUrlUtils.java index 7c4c5601..cde20472 100644 --- a/dbswitch-common/src/main/java/com/gitee/dbswitch/common/util/JdbcUrlUtils.java +++ b/dbswitch-common/src/main/java/com/gitee/dbswitch/common/util/JdbcUrlUtils.java @@ -310,9 +310,9 @@ public final class JdbcUrlUtils { } // 12、mongo数据库 - // jdbc:sqlite:/tmp/phone.db - final Matcher matcher11 = JdbcUrlUtils.getPattern("jdbc:mongodb://[{user}][:{password}@]{host}[:{port}]/[{database}][\\?{params}]") - .matcher("jdbc:mongodb://root:123456@127.0.0.1:27017/test?authSource=admin&authMechanism=SCRAM-SHA-1&expand=true"); + // jdbc:mongodb://127.0.0.1:27017/admin?authSource=admin&authMechanism=SCRAM-SHA-1 + final Matcher matcher11 = JdbcUrlUtils.getPattern("jdbc:mongodb://{host}[:{port}]/[{database}][\\?{params}]") + .matcher("jdbc:mongodb://127.0.0.1:27017/admin?authSource=admin&authMechanism=SCRAM-SHA-1"); if (matcher11.matches()) { System.out.println("mongodb database:" + matcher11.group("database")); } else {