This commit is contained in:
Redkale
2018-05-20 13:14:41 +08:00
parent bb82d70f5a
commit 324d4bd94e
3 changed files with 8 additions and 16 deletions

View File

@@ -116,6 +116,10 @@ public final class DataSources {
String url0 = url.substring(0, pos);
pos = url0.lastIndexOf(':');
if (pos > 0) dbtype = url0.substring(pos + 1);
} else { //jdbc:oracle:thin:@localhost:1521
String url0 = url.substring(url.indexOf(":") + 1);
pos = url0.indexOf(':');
if (pos > 0) dbtype = url0.substring(0, pos);
}
}
if (dbtype == null) throw re;

View File

@@ -152,22 +152,6 @@ public class PoolJdbcSource extends PoolSource<Connection> {
return 0;
}
final boolean isMysql2() {
return source != null && source.getClass().getName().contains(".mysql.");
}
final boolean isOracle2() {
return source != null && source.getClass().getName().contains("oracle.");
}
final boolean isSqlserver2() {
return source != null && source.getClass().getName().contains(".sqlserver.");
}
final boolean isPostgresql2() {
return source != null && source.getClass().getName().contains(".postgresql.");
}
private void watch() throws IOException {
if (persistxml == null || unitName == null) return;
final String file = persistxml.getFile();

View File

@@ -78,6 +78,10 @@ public abstract class PoolSource<DBChannel> {
String url0 = this.url.substring(0, pos);
pos = url0.lastIndexOf(':');
if (pos > 0) dbtype0 = url0.substring(pos + 1);
} else { //jdbc:oracle:thin:@localhost:1521
String url0 = url.substring(url.indexOf(":") + 1);
pos = url0.indexOf(':');
if (pos > 0) dbtype0 = url0.substring(0, pos);
}
}
this.dbtype = dbtype0.toLowerCase();