Hello Carl

Thanks for the reply.

Le 02/07/16 à 23:55, Carl Marcum a écrit :
> You can access databases directly using java.sql, connection pooling
> etc. without using XConnection at all as long as you have the
> connection parameters.
>
> Is there a reason you have to start with the XConnection? 

I could include a Derby' or HSQL' JAR file in the add-in .pkg file. But
that would increase the .pkg file size for a driver that may already
exists in the OpenOffice installation. More annoying, I didn't found a
way to shutdown a Derby database properly when the user quits OpenOffice
(closing the connection is not enough). I was used to do that with Java
shutdown hooks, but those hooks are apparently not executed when
OpenOffice is shutdown. I also tried to override the dispose() method of
com.sun.star.lang.XComponent without success (I suspect that its purpose
was not the one I was looking for anyway). I was hopping that if I use a
com.sun.star.sdbc.XDataSource, OpenOffice would shutdown itself the
databases behind the XDataSources.

Another reason is that I need a directory where to create the Derby or
HSQL database. For now, I prefer to leave that choice to the user (I
realize that we may need a more automatic process in the future). For
applications outside OpenOffice, we currently ask the user to define an
environment variable. For OpenOffice, setting such environment variable
seems unconvenient. I though that instead, I could ask the user to
create an initially empty database of a given name as an OpenOffice data
source. Even if in the future we make the process more automatic, I
still wish to make easier for advanced users to query the database
themselves using Base.

Thanks,

    Martin



---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org

Reply via email to