use of org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration in project dbeaver by dbeaver.
the class ConnectionPageInitialization method activatePage.
@Override
public void activatePage() {
if (dataSourceDescriptor != null) {
if (!activated) {
// Get settings from data source descriptor
final DBPConnectionConfiguration conConfig = dataSourceDescriptor.getConnectionConfiguration();
autocommit.setSelection(dataSourceDescriptor.isDefaultAutoCommit());
isolationLevel.add("");
DataSourceDescriptor originalDataSource = getWizard().getOriginalDataSource();
if (originalDataSource != null && originalDataSource.isConnected()) {
DBPDataSource dataSource = originalDataSource.getDataSource();
loadDatabaseSettings(dataSource);
}
defaultCatalog.setText(CommonUtils.notEmpty(conConfig.getBootstrap().getDefaultCatalogName()));
defaultSchema.setText(CommonUtils.notEmpty(conConfig.getBootstrap().getDefaultSchemaName()));
keepAliveInterval.setSelection(conConfig.getKeepAliveInterval());
activated = true;
}
} else {
// Default settings
isolationLevel.setEnabled(false);
defaultCatalog.setText("");
defaultSchema.setText("");
}
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration in project dbeaver by dbeaver.
the class AthenaConnectionPage method loadSettings.
@Override
public void loadSettings() {
super.loadSettings();
// Load values from new connection info
DBPConnectionConfiguration connectionInfo = site.getActiveDataSource().getConnectionConfiguration();
if (awsRegionCombo != null) {
awsRegionCombo.removeAll();
for (AWSRegion region : AWSRegion.values()) {
awsRegionCombo.add(region.getId());
}
if (!CommonUtils.isEmpty(connectionInfo.getServerName())) {
awsRegionCombo.setText(connectionInfo.getServerName());
}
if (awsRegionCombo.getText().isEmpty()) {
awsRegionCombo.setText(AWSRegion.us_west_1.getId());
}
}
if (s3LocationText != null) {
String databaseName = connectionInfo.getDatabaseName();
if (CommonUtils.isEmpty(databaseName)) {
// $NON-NLS-1$
databaseName = "s3://";
}
s3LocationText.setText(databaseName);
}
if (accessKeyText != null) {
accessKeyText.setText(CommonUtils.notEmpty(connectionInfo.getUserName()));
}
if (passwordText != null) {
passwordText.setText(CommonUtils.notEmpty(connectionInfo.getUserPassword()));
}
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration in project dbeaver by dbeaver.
the class AthenaConnectionPage method saveSettings.
@Override
public void saveSettings(DBPDataSourceContainer dataSource) {
DBPConnectionConfiguration connectionInfo = dataSource.getConnectionConfiguration();
if (awsRegionCombo != null) {
connectionInfo.setServerName(awsRegionCombo.getText().trim());
}
if (s3LocationText != null) {
connectionInfo.setDatabaseName(s3LocationText.getText().trim());
}
if (accessKeyText != null) {
connectionInfo.setUserName(accessKeyText.getText().trim());
}
if (passwordText != null && savePasswordCheck.getSelection()) {
connectionInfo.setUserPassword(passwordText.getText().trim());
}
super.saveSettings(dataSource);
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration in project dbeaver by dbeaver.
the class DB2ConnectionPage method loadSettings.
@Override
public void loadSettings() {
super.loadSettings();
// Load values from new connection info
DBPConnectionConfiguration connectionInfo = site.getActiveDataSource().getConnectionConfiguration();
if (hostText != null) {
hostText.setText(CommonUtils.notEmpty(connectionInfo.getHostName()));
}
if (portText != null) {
if (!CommonUtils.isEmpty(connectionInfo.getHostPort())) {
portText.setText(String.valueOf(connectionInfo.getHostPort()));
} else if (site.getDriver().getDefaultPort() != null) {
portText.setText(site.getDriver().getDefaultPort());
} else {
// $NON-NLS-1$
portText.setText("");
}
}
if (dbText != null) {
dbText.setText(CommonUtils.notEmpty(connectionInfo.getDatabaseName()));
}
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration in project dbeaver by dbeaver.
the class OracleScriptExecuteHandler method getCommandLine.
@Override
protected List<String> getCommandLine(OracleScriptExecuteSettings settings, OracleDataSource arg) throws IOException {
List<String> cmd = new ArrayList<>();
fillProcessParameters(settings, arg, cmd);
DBPConnectionConfiguration conInfo = settings.getDataSourceContainer().getActualConnectionConfiguration();
String url;
if ("TNS".equals(conInfo.getProviderProperty(OracleConstants.PROP_CONNECTION_TYPE))) {
// $NON-NLS-1$
url = conInfo.getServerName();
} else {
boolean isSID = OracleConnectionType.SID.name().equals(conInfo.getProviderProperty(OracleConstants.PROP_SID_SERVICE));
String port = conInfo.getHostPort();
if (isSID) {
url = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=" + conInfo.getHostName() + ")(Port=" + port + "))(CONNECT_DATA=(SID=" + conInfo.getDatabaseName() + ")))";
} else {
// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
url = "//" + conInfo.getHostName() + (port != null ? ":" + port : "") + "/" + conInfo.getDatabaseName();
}
}
final String role = conInfo.getProviderProperty(OracleConstants.PROP_INTERNAL_LOGON);
if (role != null) {
url += (" AS " + role);
}
// $NON-NLS-1$ //$NON-NLS-2$
cmd.add(conInfo.getUserName() + "/" + conInfo.getUserPassword() + "@" + url);
/*
if (toolWizard.isVerbose()) {
cmd.add("-v");
}
cmd.add("-q");
cmd.add(toolWizard.getDatabaseObjects().getName());
*/
return cmd;
}
Aggregations