use of org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration in project dbeaver by dbeaver.
the class OracleConnectionPage method saveSettings.
@Override
public void saveSettings(DBPDataSourceContainer dataSource) {
DBPConnectionConfiguration connectionInfo = dataSource.getConnectionConfiguration();
connectionInfo.setClientHomeId(oraHomeSelector.getSelectedHome());
connectionInfo.setProviderProperty(OracleConstants.PROP_CONNECTION_TYPE, connectionType.name());
switch(connectionType) {
case BASIC:
connectionInfo.setHostName(hostText.getText().trim());
connectionInfo.setHostPort(portText.getText().trim());
connectionInfo.setDatabaseName(serviceNameCombo.getText().trim());
break;
case TNS:
connectionInfo.setDatabaseName(tnsNameCombo.getText().trim());
connectionInfo.setProviderProperty(OracleConstants.PROP_TNS_PATH, tnsPathText.getText().trim());
break;
case CUSTOM:
connectionInfo.setUrl(connectionUrlText.getText().trim());
break;
}
connectionInfo.setProviderProperty(OracleConstants.PROP_SID_SERVICE, OracleConnectionType.getTypeForTitle(sidServiceCombo.getText()).name());
super.saveSettings(dataSource);
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration in project dbeaver by dbeaver.
the class OracleDataSourceProvider method getObjectInformation.
@Nullable
@Override
public String getObjectInformation(@NotNull DBPObject object, @NotNull String infoType) {
if (object instanceof DBPDataSourceContainer && infoType.equals(INFO_TARGET_ADDRESS)) {
DBPConnectionConfiguration connectionInfo = ((DBPDataSourceContainer) object).getConnectionConfiguration();
OracleConstants.ConnectionType connectionType = getConnectionType(connectionInfo);
if (connectionType == OracleConstants.ConnectionType.CUSTOM) {
return JDBCURL.generateUrlByTemplate(connectionInfo.getUrl(), connectionInfo);
}
String databaseName = CommonUtils.notEmpty(connectionInfo.getDatabaseName());
if (connectionType == OracleConstants.ConnectionType.TNS) {
return databaseName;
} else {
String hostName = DataSourceUtils.getTargetTunnelHostName(connectionInfo);
String hostPort = connectionInfo.getHostPort();
if (CommonUtils.isEmpty(hostName)) {
return null;
} else if (CommonUtils.isEmpty(hostPort)) {
return hostName;
} else {
return hostName + ":" + hostPort;
}
}
}
return null;
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration in project dbeaver by dbeaver.
the class OracleConnectionExtraPage method loadSettings.
@Override
public void loadSettings() {
// oraHomeSelector.setVisible(isOCI);
// Load values from new connection info
DBPConnectionConfiguration connectionInfo = site.getActiveDataSource().getConnectionConfiguration();
Map<String, String> providerProperties = connectionInfo.getProviderProperties();
// Settings
final Object nlsLanguage = providerProperties.get(OracleConstants.PROP_SESSION_LANGUAGE);
if (nlsLanguage != null) {
languageCombo.setText(nlsLanguage.toString());
}
final Object nlsTerritory = providerProperties.get(OracleConstants.PROP_SESSION_TERRITORY);
if (nlsTerritory != null) {
territoryCombo.setText(nlsTerritory.toString());
}
nlsDateFormat.setText(CommonUtils.toString(providerProperties.get(OracleConstants.PROP_SESSION_NLS_DATE_FORMAT)));
nlsTimestampFormat.setText(CommonUtils.toString(providerProperties.get(OracleConstants.PROP_SESSION_NLS_TIMESTAMP_FORMAT)));
nlsLengthFormat.setText(CommonUtils.toString(providerProperties.get(OracleConstants.PROP_SESSION_NLS_LENGTH_FORMAT)));
nlsCurrencyFormat.setText(CommonUtils.toString(providerProperties.get(OracleConstants.PROP_SESSION_NLS_CURRENCY_FORMAT)));
final Object checkSchemaContent = providerProperties.get(OracleConstants.PROP_CHECK_SCHEMA_CONTENT);
if (checkSchemaContent != null) {
hideEmptySchemasCheckbox.setSelection(CommonUtils.getBoolean(checkSchemaContent, false));
}
showDBAAlwaysCheckbox.setSelection(CommonUtils.getBoolean(providerProperties.get(OracleConstants.PROP_ALWAYS_SHOW_DBA), false));
useDBAViewsCheckbox.setSelection(CommonUtils.getBoolean(providerProperties.get(OracleConstants.PROP_ALWAYS_USE_DBA_VIEWS), false));
useSysSchemaCheckbox.setSelection(CommonUtils.getBoolean(providerProperties.get(OracleConstants.PROP_METADATA_USE_SYS_SCHEMA), false));
useSimpleConstraints.setSelection(CommonUtils.getBoolean(providerProperties.get(OracleConstants.PROP_METADATA_USE_SIMPLE_CONSTRAINTS), false));
useRuleHint.setSelection(CommonUtils.getBoolean(providerProperties.get(OracleConstants.PROP_USE_RULE_HINT), false));
useOptimizerHint.setSelection(CommonUtils.getBoolean(providerProperties.get(OracleConstants.PROP_USE_META_OPTIMIZER), false));
useAlternativeTableMetadataQuery.setSelection(CommonUtils.getBoolean(providerProperties.get(OracleConstants.PROP_METADATA_USE_ALTERNATIVE_TABLE_QUERY), false));
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration in project dbeaver by dbeaver.
the class PostgreNativeToolHandler method fillProcessParameters.
@Override
public void fillProcessParameters(SETTINGS settings, PROCESS_ARG process_arg, List<String> cmd) throws IOException {
File dumpBinary = RuntimeUtils.getNativeClientBinary(settings.getClientHome(), PostgreConstants.BIN_FOLDER, this instanceof PostgreDatabaseBackupHandler ? "pg_dump" : // $NON-NLS-1$
this instanceof PostgreDatabaseRestoreHandler ? "pg_restore" : "psql");
String dumpPath = dumpBinary.getAbsolutePath();
cmd.add(dumpPath);
if (isVerbose()) {
cmd.add("--verbose");
}
DBPConnectionConfiguration connectionInfo = settings.getDataSourceContainer().getActualConnectionConfiguration();
cmd.add("--host=" + connectionInfo.getHostName());
if (!CommonUtils.isEmpty(connectionInfo.getHostPort())) {
cmd.add("--port=" + connectionInfo.getHostPort());
}
String toolUserName = settings.getToolUserName();
if (CommonUtils.isEmpty(toolUserName)) {
toolUserName = connectionInfo.getUserName();
}
cmd.add("--username=" + toolUserName);
settings.addExtraCommandArgs(cmd);
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration in project dbeaver by dbeaver.
the class ExasolConnectionPage method saveSettings.
@Override
public void saveSettings(DBPDataSourceContainer dataSource) {
DBPConnectionConfiguration connectionInfo = dataSource.getConnectionConfiguration();
if (hostText != null) {
connectionInfo.setHostName(hostText.getText().trim());
}
if (portText != null) {
connectionInfo.setHostPort(portText.getText().trim());
}
connectionInfo.setProviderProperty(ExasolUIConstants.DRV_BACKUP_HOST_LIST, backupHostText.getText());
if (this.encryptCommunication.getSelection())
// $NON-NLS-1$
connectionInfo.setProviderProperty(ExasolUIConstants.DRV_ENCRYPT, "1");
super.saveSettings(dataSource);
}
Aggregations