db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fernando Freitas <nand...@gmail.com>
Subject Re: configuration derby plugin for eclipse
Date Thu, 26 Mar 2009 17:22:46 GMT
Dear Charlie,
         I create a plugin from existing jars archives with derby jars
files.


I am still without any progress. I am confuse with your code.
Somebody help me?

(in your code)
1) What is hibernatePropertiesPlugin? What Object is this ?

2) How to create a database from a another bundle?

3) How to define the path location of the database?



Best Regards
Fernando

2009/3/19 Charlie Kelly <Charlie@charliekelly.com>

> Hi Fernando,
>
> I use Eclipse with Derby and Hibernate.
>
> I find it helpful to create a project that has all the jar files needed by
> Derby, Eclipse, and other programs (for example, Velocity).
> You can use Eclipse's wizard to create a plugin from existing jar archives
> (File->New->Project->Plugin Development->Plugin from existing jar archives).
>
> You can create a properties file and folder in your plugin and access it
> with code that is similar to the following:
>
>           hibernatePropertiesPlugin =
> MetaPersistenceActivator.getDefault();
>           String propertiesFileNameFQ = "properties/hibernate.properties";
>                     Path hibernatePropertiesPath = new
> Path(propertiesFileNameFQ);
>           Bundle hibernatePropertiesBundle =
> hibernatePropertiesPlugin.getBundle();
>                     URL hibernatePropertiesURL  = FileLocator.find
> (hibernatePropertiesBundle, hibernatePropertiesPath, null);
>           if (null == hibernatePropertiesURL)
>               throw new Exception ("URL is null for: " +
> propertiesFileNameFQ);
>
>           boolean substituteArgumentsFlag = false;
>           InputStream hibernatePropertiesInputStream =
> FileLocator.openStream(hibernatePropertiesBundle, hibernatePropertiesPath,
> substituteArgumentsFlag);
>           int availableBytes = hibernatePropertiesInputStream.available();
>           if (availableBytes <= 0)
>               throw new Exception ("nothing available from
> properties/hibernate.properties");
> hibernateProperties.load(hibernatePropertiesInputStream);
>
> Use the name of the Activator for your plugin instead of
> "MetaPersitenceActivator"
> "Path" is contained in org.eclipse.core.resources (which you must include
> as a dependency for your plugin).
>
> Hope this helps.
>
> Charlie
>
>
> Fernando Freitas wrote:
>
>> Hi People,
>>
>> sorry to repeat the question
>> but, I forgot a detail,
>> I am eclipse user and I am using the derby like plugin (bundle).
>>
>> So , I don't know where the files was created.
>>
>> Can you help me?
>>
>> In this case (derby plugin for eclipse)
>>
>> 1) How could I use some file xml or another configuration file configure
>> the database, like to choose the place that I will create my Database's
>> instance.
>>
>> 2) Where Derby save your files of database.?
>>
>> Thanks and Best Regards
>> Fernando
>>
>

Mime
View raw message