public void init() {
try {
if (configPath != null) {
File file = new File(configPath);
if (file.exists()) {
IConfig config = MConfigFactory.getInstance().createConfigFor(file);
IConfig cDb = config.getConfig("database");
if (cDb == null) {
cDb = config.createConfig("database");
}
IConfig cConnection = cDb.getConfig("connection");
if (cConnection == null) {
cConnection = cDb.createConfig("connection");
}
if (!MString.isEmpty(password)) cConnection.setString("pass", password);
if (!MString.isEmpty(url)) cConnection.setString("url", url);
if (!MString.isEmpty(user)) cConnection.setString("user", user);
if (!MString.isEmpty(driver)) cConnection.setString("driver", driver);
setConfig(config);
}
}
} catch (Throwable t) {
log.d(t);