use of org.compiere.db.CConnection in project adempiere by adempiere.
the class ConfigurationData method saveIni.
// save
/**
* Synchronize and save Connection Info in Ini
* @return true
*/
private boolean saveIni() {
Ini.setAdempiereHome(m_adempiereHome.getAbsolutePath());
// Create Connection
String url = null;
try {
String ccType = Database.DB_ORACLE;
// For others
if (!getDatabaseType().equals(Database.DB_ORACLE)) {
ccType = getDatabaseType();
}
//
CConnection cc = CConnection.get(ccType, getDatabaseServer(), getDatabasePort(), getDatabaseName(), getDatabaseUser(), getDatabasePassword());
cc.setAppsHost(getAppsServer());
cc.setAppsPort(getAppsServerJNPPort());
cc.setConnectionProfile(CConnection.PROFILE_LAN);
url = cc.toStringLong();
} catch (Exception e) {
log.log(Level.SEVERE, "connection", e);
return false;
}
if (url == null) {
log.warning("No Connection");
return false;
}
Ini.setProperty(Ini.P_CONNECTION, url);
Ini.saveProperties(false);
return true;
}
Aggregations