This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Database Connection Profiles
Andrej Podhradsky edited this page Oct 22, 2013
·
1 revision
Creating connection profiles in Red Deer is done in 2 steps
- Creating a driver definition
- Creating the database connection profile itself
The driver definition is created from preference page
DriverDefinitionPreferencePage preferencePage = new DriverDefinitionPreferencePage();
preferencePage.open();
DriverDefinitionWizard wizard = preferencePage.addDriverDefinition();
DriverDefinitionPage page = wizard.getFirstPage();
page.selectDriverTemplate("HSQLDB JDBC Driver", "1.8");
page.setName("Test HSLQDB Driver");
page.addDriverLibrary(new File("hsqldb-1.8.0.10.jar").getAbsolutePath());
wizard.finish();
preferencePage.ok();
The easiest way how to create a connection profile is to use a help class org.jboss.reddeer.eclipse.datatools.ui.DatabaseProfile. Using this class you can set the following properties
- name
- database
- hostname
- port
- username
- password
- vendor
- url
and then creating the database connection profile is very easy
ConnectionProfileWizard wizard = new ConnectionProfileWizard();
wizard.open();
wizard.createDatabaseProfile(databaseProfile);
Currently we support the following vendors
- Oracle
- SQL Server
If you need to support another vendor, just create appropriate ConnectionProfileDatabasePage and add it as follows
public class TeiidConnectionProfileWizard extends ConnectionProfileWizard {
public TeiidConnectionProfileWizard() {
super();
wizardMap.put("HSQLDB", new ConnectionProfileHsqlPage(this, 2));
wizardMap.put("XML File URL Source", new ConnectionProfileXmlUrlPage(this, 2));
wizardMap.put("XML Local File Source", new ConnectionProfileXmlLocalPage(this, 2));
}
}