Commit 6b32873 1 parent 3450947 commit 6b32873 Copy full SHA for 6b32873
File tree 1 file changed +6
-3
lines changed
core/src/main/java/com/databasir/core/infrastructure/connection
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,17 @@ public Connection getConnection(Context context) throws SQLException {
71
71
throw DomainErrors .CONNECT_DATABASE_FAILED .exception ("驱动初始化异常:" + e .getMessage ());
72
72
}
73
73
74
+ Properties info = new Properties ();
75
+ info .put ("user" , context .getUsername ());
76
+ info .put ("password" , context .getPassword ());
77
+ if (context .getProperties () != null && !context .getProperties ().isEmpty ()) {
78
+ info .putAll (context .getProperties ());
79
+ }
74
80
String urlPattern = type .getUrlPattern ();
75
81
String jdbcUrl = urlPattern .replace ("{{jdbc.protocol}}" , type .getJdbcProtocol ())
76
82
.replace ("{{db.url}}" , context .getUrl ())
77
83
.replace ("{{db.name}}" , context .getDatabaseName ())
78
84
.replace ("{{db.schema}}" , context .getSchemaName ());
79
- Properties info = new Properties ();
80
- info .put ("user" , context .getUsername ());
81
- info .put ("password" , context .getPassword ());
82
85
return driver .connect (jdbcUrl , info );
83
86
}
84
87
You can’t perform that action at this time.
0 commit comments