Author: vpakan(a)redhat.com
Date: 2010-03-23 11:25:38 -0400 (Tue, 23 Mar 2010)
New Revision: 20982
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DatabaseHelper.java
Log:
Added possibility to specify connection profile name when creating connection profile
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DatabaseHelper.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DatabaseHelper.java 2010-03-23
14:25:55 UTC (rev 20981)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/DatabaseHelper.java 2010-03-23
15:25:38 UTC (rev 20982)
@@ -29,7 +29,7 @@
* @throws ConnectionProfileException
* @return driver instance
*/
- public static void createDriver(DriverEntity entity) throws ConnectionProfileException
{
+ public static void createDriver(DriverEntity entity, String profileName) throws
ConnectionProfileException {
String driverPath;
try {
driverPath = new File(entity.getDrvPath()).getCanonicalPath(); //$NON-NLS-1$
@@ -67,7 +67,7 @@
}
driver =
DriverManager.getInstance().getDriverInstanceByName(entity.getInstanceName());
- if (driver != null &&
ProfileManager.getInstance().getProfileByName("DefaultDS") == null) {
//$NON-NLS-1$
+ if (driver != null &&
ProfileManager.getInstance().getProfileByName(profileName) == null) { //$NON-NLS-1$
// create profile
Properties props = new Properties();
props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID,
"DriverDefn.Hypersonic DB");
@@ -84,4 +84,14 @@
ProfileManager.getInstance().createProfile(entity.getProfileName(), entity.getProfileDescription(),
IDBConnectionProfileConstants.CONNECTION_PROFILE_ID, props, "", false);
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
+
+ /**
+ * Create HSQLDB Driver and default connection profile
+ * @throws ConnectionProfileException
+ * @return driver instance
+ */
+ public static void createDriver(DriverEntity entity) throws ConnectionProfileException
{
+ createDriver(entity,"DefaultDS");
+ }
+
}
Show replies by date