File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
core/src/main/java/com/databasir/core/infrastructure/connection Expand file tree Collapse file tree 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 {
7171 throw DomainErrors .CONNECT_DATABASE_FAILED .exception ("驱动初始化异常:" + e .getMessage ());
7272 }
7373
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+ }
7480 String urlPattern = type .getUrlPattern ();
7581 String jdbcUrl = urlPattern .replace ("{{jdbc.protocol}}" , type .getJdbcProtocol ())
7682 .replace ("{{db.url}}" , context .getUrl ())
7783 .replace ("{{db.name}}" , context .getDatabaseName ())
7884 .replace ("{{db.schema}}" , context .getSchemaName ());
79- Properties info = new Properties ();
80- info .put ("user" , context .getUsername ());
81- info .put ("password" , context .getPassword ());
8285 return driver .connect (jdbcUrl , info );
8386 }
8487
You can’t perform that action at this time.
0 commit comments