Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Generating a DDL from java
Generating a DDL from java [message #46956] Tue, 15 July 2008 12:48 Go to next message
Eclipse UserFriend
Originally posted by: hayden.il.ibm.com

I need to be able to generate DDL and execute them against DB connections,
based on a data-model (tables & columns) that I will be reading from a
file. At this stage I am not sure of the file format that I will use.

Can someone point me to the relevant classes, preferably with some sample
code to give me a head start.

Also, if there is a pre-existing format for the datamodel that is tightly
integrated with the DTP project (e.g. EMF model) in which they can be
saved, with a relevant UI tool for editing the data-model, that would also
be fantastic

As an API user, I found it pretty tricky finding relevant documentation on
the DTP APIs - I realise that most usage of DTP is done through other
Eclipse projects, but I am a little stuck at the moment.

Thanks,
Hayden
Re: Generating a DDL from java [message #47075 is a reply to message #46956] Wed, 16 July 2008 16:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brianf.sybase.com

Hi Hayden...

Just so you don't think we're ignoring you, I'm pondering your question and
trying to come up with a response. Most of what I do is UI-driven, so I
don't often think about going bottom up. Hope to get back to you in a day or
two if that's ok.

--Fitz

"Hayden Marchant" <hayden@il.ibm.com> wrote in message
news:a3c17af3d4c6fde4ca29dd08894eea99$1@www.eclipse.org...
>I need to be able to generate DDL and execute them against DB connections,
>based on a data-model (tables & columns) that I will be reading from a
>file. At this stage I am not sure of the file format that I will use.
> Can someone point me to the relevant classes, preferably with some sample
> code to give me a head start.
>
> Also, if there is a pre-existing format for the datamodel that is tightly
> integrated with the DTP project (e.g. EMF model) in which they can be
> saved, with a relevant UI tool for editing the data-model, that would also
> be fantastic
>
> As an API user, I found it pretty tricky finding relevant documentation on
> the DTP APIs - I realise that most usage of DTP is done through other
> Eclipse projects, but I am a little stuck at the moment.
>
> Thanks,
> Hayden
>
Re: Generating a DDL from java [message #47497 is a reply to message #46956] Mon, 21 July 2008 16:26 Go to previous message
Eclipse UserFriend
Originally posted by: brianf.sybase.com

Hi Hayden...

Sorry this took a bit. Got tied up at the end of last week.

So... I'm attaching a plug-in that contributes an action to the Data Source
Explorer on a connection profile. If you run the action on a connected
profile (like on a connected Derby profile), it'll save out an xmi file to
c:\<mydbname>\cache.xmi.

This code is very similar to the Save/Work Offline actions in the DSE
currently.

What does this get you? Well, the XMI file conforms to the SQL model, which
is an EMF model in the DTP Modelbase project. You can open the XMI file in
an EMF editor to poke around at it. And you can use the EMF API to poke
around in it code-wise.

That should allow you to get the info you need to create your DDL.

Now executing the DDL via API is another question... Has anybody tried that?
If not, I can poke around some more to see if I can figure it out.

Hope this helps!

--Fitz

"Hayden Marchant" <hayden@il.ibm.com> wrote in message
news:a3c17af3d4c6fde4ca29dd08894eea99$1@www.eclipse.org...
>I need to be able to generate DDL and execute them against DB connections,
> based on a data-model (tables & columns) that I will be reading from a
> file. At this stage I am not sure of the file format that I will use.
>
> Can someone point me to the relevant classes, preferably with some sample
> code to give me a head start.
>
> Also, if there is a pre-existing format for the datamodel that is tightly
> integrated with the DTP project (e.g. EMF model) in which they can be
> saved, with a relevant UI tool for editing the data-model, that would also
> be fantastic
>
> As an API user, I found it pretty tricky finding relevant documentation on
> the DTP APIs - I realise that most usage of DTP is done through other
> Eclipse projects, but I am a little stuck at the moment.
>
> Thanks,
> Hayden
>


Re: Generating a DDL from java [message #592013 is a reply to message #46956] Wed, 16 July 2008 16:31 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 500
Registered: July 2009
Senior Member
Hi Hayden...

Just so you don't think we're ignoring you, I'm pondering your question and
trying to come up with a response. Most of what I do is UI-driven, so I
don't often think about going bottom up. Hope to get back to you in a day or
two if that's ok.

--Fitz

"Hayden Marchant" <hayden@il.ibm.com> wrote in message
news:a3c17af3d4c6fde4ca29dd08894eea99$1@www.eclipse.org...
>I need to be able to generate DDL and execute them against DB connections,
>based on a data-model (tables & columns) that I will be reading from a
>file. At this stage I am not sure of the file format that I will use.
> Can someone point me to the relevant classes, preferably with some sample
> code to give me a head start.
>
> Also, if there is a pre-existing format for the datamodel that is tightly
> integrated with the DTP project (e.g. EMF model) in which they can be
> saved, with a relevant UI tool for editing the data-model, that would also
> be fantastic
>
> As an API user, I found it pretty tricky finding relevant documentation on
> the DTP APIs - I realise that most usage of DTP is done through other
> Eclipse projects, but I am a little stuck at the moment.
>
> Thanks,
> Hayden
>
Re: Generating a DDL from java [message #592140 is a reply to message #46956] Mon, 21 July 2008 16:26 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 500
Registered: July 2009
Senior Member
Hi Hayden...

Sorry this took a bit. Got tied up at the end of last week.

So... I'm attaching a plug-in that contributes an action to the Data Source
Explorer on a connection profile. If you run the action on a connected
profile (like on a connected Derby profile), it'll save out an xmi file to
c:\<mydbname>\cache.xmi.

This code is very similar to the Save/Work Offline actions in the DSE
currently.

What does this get you? Well, the XMI file conforms to the SQL model, which
is an EMF model in the DTP Modelbase project. You can open the XMI file in
an EMF editor to poke around at it. And you can use the EMF API to poke
around in it code-wise.

That should allow you to get the info you need to create your DDL.

Now executing the DDL via API is another question... Has anybody tried that?
If not, I can poke around some more to see if I can figure it out.

Hope this helps!

--Fitz

"Hayden Marchant" <hayden@il.ibm.com> wrote in message
news:a3c17af3d4c6fde4ca29dd08894eea99$1@www.eclipse.org...
>I need to be able to generate DDL and execute them against DB connections,
> based on a data-model (tables & columns) that I will be reading from a
> file. At this stage I am not sure of the file format that I will use.
>
> Can someone point me to the relevant classes, preferably with some sample
> code to give me a head start.
>
> Also, if there is a pre-existing format for the datamodel that is tightly
> integrated with the DTP project (e.g. EMF model) in which they can be
> saved, with a relevant UI tool for editing the data-model, that would also
> be fantastic
>
> As an API user, I found it pretty tricky finding relevant documentation on
> the DTP APIs - I realise that most usage of DTP is done through other
> Eclipse projects, but I am a little stuck at the moment.
>
> Thanks,
> Hayden
>


Previous Topic:PostgreSQL sequences
Next Topic:[ODA Ecore] Integration and Deployment Questions
Goto Forum:
  


Current Time: Thu Apr 18 22:30:40 GMT 2024

Powered by FUDForum. Page generated in 0.01978 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top