Programmatically access a JDBC connection via DTP [message #596471] |
Wed, 30 September 2009 13:24  |
Eclipse User |
|
|
|
Is there any external documentation/example showing how to programmatically access a JDBC connection via DTP and create/populate tables via DTP. I am trying to develop a plugins which requires JDBC connection to persistent some of the data in database.
Thanks.
Joshua
|
|
|
|
|
Re: Programmatically access a JDBC connection via DTP [message #596654 is a reply to message #596567] |
Wed, 14 October 2009 15:35  |
Eclipse User |
|
|
|
Ok... First, the DDL question... The only example I can find is this:
private void executeDDL(String[] sqlStatements,
IConnectionProfile connectionProfile) {
DatabaseIdentifier databaseIdentifier = new DatabaseIdentifier(
connectionProfile.getName(), "");
if (databaseIdentifier != null) {
try {
Job job = new GroupSQLResultRunnable(null, sqlStatements, null,
null, databaseIdentifier, false, new HashMap(),
Messages.BaseExecuteAction_group_exec_title,
"Generate DDL");
job.setName(Messages.BaseExecuteAction_job_title);
job.setUser(true);
job.schedule();
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().showView(EditorConstants.RESULTS_VIEW);
} catch (Exception e) {
}
}
}
For the ability to pop up the property page as we do, check out
ConnectAction in o.e.d.connectivity.ui in the
o.e.d.connectivity.ui.actions package. The public void run(IAction
action) method pops up the dialog.
--Fitz
Joshua Hui wrote:
> Hi Fitz,
>
> It will be the latter one which is to execute the DDL file using the
> IConnectionProfile.
>
> Also, if not all the properties are specified (i.e.
> arePropertiesComplete() is false), can I bring up the same properties
> dialog to allow user to enter the valid connection information? If so,
> which command should I use?
>
> Thanks for your help!
>
> Joshua
>
|
|
|
Powered by
FUDForum. Page generated in 0.43883 seconds