Commit 9fa4a6d2 authored by Andrey Lugovskiy's avatar Andrey Lugovskiy Committed by Matija Obreza

- fixed jdbc url string

parent ae6c557f
......@@ -21,10 +21,10 @@
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
\ No newline at end of file
</assembly>
......@@ -21,10 +21,10 @@
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
\ No newline at end of file
</assembly>
......@@ -25,10 +25,10 @@
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:jar:4.3</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
\ No newline at end of file
</assembly>
......@@ -25,10 +25,10 @@
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3.2</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86:jar:4.3</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:4.3</exclude>
<exclude>org.eclipse.swt:org.eclipse.swt.gtk.linux.x86_64:jar:4.3</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
\ No newline at end of file
</assembly>
......@@ -31,6 +31,8 @@ import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
......@@ -93,10 +95,10 @@ public class DatabaseDialog extends Dialog {
public DatabaseDialog(Shell parent, TreeViewer treeViewer, int style) {
super(parent, style);
this.treeViewer = treeViewer;
this.databaseSettings=new DatabaseSettings();
this.databaseSettings = new DatabaseSettings();
setText("Add Database");
}
public void setDatabaseSettings(DatabaseSettings databaseSettings) {
this.databaseSettings = databaseSettings;
}
......@@ -142,6 +144,7 @@ public class DatabaseDialog extends Dialog {
/* Datasource type */
Label lblType = new Label(grpDbConfiguration, SWT.NONE);
lblType.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
lblType.setAlignment(SWT.RIGHT);
lblType.setText("Database type");
comboType = new Combo(grpDbConfiguration, SWT.NONE);
......@@ -166,6 +169,7 @@ public class DatabaseDialog extends Dialog {
txtName = new Text(grpDbConfiguration, SWT.BORDER);
txtName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
/* Connection URL */
Label lblDbUrl = new Label(grpDbConfiguration, SWT.NONE);
lblDbUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
......@@ -174,6 +178,12 @@ public class DatabaseDialog extends Dialog {
txtDbUrl = new Text(grpDbConfiguration, SWT.BORDER);
txtDbUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
txtDbUrl.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
txtDbUrl.setSelection(txtDbUrl.getText().length());
}
});
/* User */
Label lblDbUserName = new Label(grpDbConfiguration, SWT.NONE);
lblDbUserName.setAlignment(SWT.RIGHT);
......@@ -190,12 +200,12 @@ public class DatabaseDialog extends Dialog {
txtDbPassword = new Text(grpDbConfiguration, SWT.BORDER | SWT.PASSWORD);
txtDbPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Label lblProperties = new Label(grpDbConfiguration, SWT.NONE);
lblProperties.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
lblProperties.setText("Additional JDBC properties");
lblProperties.setAlignment(SWT.RIGHT);
txtDbProperties = new Text(grpDbConfiguration, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
GridData gd_txtDbProperties = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
gd_txtDbProperties.heightHint = 60;
......@@ -261,11 +271,11 @@ public class DatabaseDialog extends Dialog {
Properties props = new Properties();
props.put("user", this.txtDbUserName.getText());
props.put("password", this.txtDbPassword.getText());
props.put("charSet", "windows-1250");
props.put("charSet", "windows-1250");
try {
connection = ConnectionUtils.getConnection(databaseSettings.getDriverClassName(), this.txtDbUrl.getText(), props);
try {
connection = ConnectionUtils.getConnection(databaseSettings.getDriverClassName(), this.txtDbUrl.getText(), props);
} catch (ClassNotFoundException e) {
message = "Could not load JDBC driver " + e.getMessage();
} catch (SQLException e) {
......@@ -299,6 +309,7 @@ public class DatabaseDialog extends Dialog {
this.shell.close();
ConnectionUtils.close(connection);
}
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment