SQL Editor -Update Connection Profile programmatic way [message #661044] |
Tue, 22 March 2011 17:16  |
Eclipse User |
|
|
|
Hi,
I want to edit the connection profile that an SQL scrapbook is associated with from the Java code.
I am updating this based on the connection profile selected in SQL Explorer.
My code looks like this :
ISQLEditorConnectionInfo sqlConnectioninfo=((SQLEditor)activeeditor).getConnectionInf o();
sqlConnectioninfo.setConnectionProfileName(conprof.getName() );
sqlConnectioninfo.setProfileStatus(conprof.getConnectionStat e());
Properties properties = conprof.getBaseProperties();
String schemaName= properties.get("org.eclipse.datatools.connectivity.db.databaseName ").toString();
sqlConnectioninfo.setDefaultSchemaName(schemaName);
sqlConnectioninfo.setDatabaseVendorDefinitionId(new
DatabaseVendorDefinitionId(properties.getProperty("org.eclipse.datatools.connectivity.db.vendor ").toString(),properties.getProperty("org.eclipse.datatools.connectivity.db.version ").toString()));
((SQLEditor)activeeditor).setConnectionInfo(sqlConnectioninf o);
((SQLEditor) activeeditor).refreshConnectionStatus();
This does update the Type , Name and Status in connection Profile.
How can I select a default value for Database: field ??
Please find snapshot here:
https:// docs.google.com/leaf?id=0B6xpLLyeT_sYMmUxZDQzZWUtNjVmYS00YWE yLWFhMGYtZDdiODJlM2RmZDY3&sort=name&layout=list& num=50
Thank you,
Swati
|
|
|
|
Powered by
FUDForum. Page generated in 3.35056 seconds