List Info

Thread: Base data source




Base data source
user name
2007-06-11 15:56:12
Dear Frank:

Thanks for the advice.
* a_base_XComponent = XComponentLoader.loadComponentFromURL(
... );
  (The base file can be loaded in hidden mode.)

Questions about the next steps:
* How to extract sdbc.XConnection from a_base_XComponent?
* How to extract java.sql.Connection from a
sdbc.XConnection?

Ray

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Base data source
user name
2007-06-12 01:15:04
Hi Ray,

> Questions about the next steps:
> * How to extract sdbc.XConnection from
a_base_XComponent?

The Controller of the loaded document supports
XDatabaseDocumentUI [1],
which has a member ActiveConnection.

However, if your goal is to obtain a connection for a given
database
document, you do not need to load it into a (hidden) frame.

Just do a
createUnoService(
"com.sun.star.sdb.DatabaseContext" ).getByName( _
  <file_url> )

This will give you a DataSource instance, which can be
queried for its
DatabaseDocument.

> * How to extract java.sql.Connection from a
sdbc.XConnection?

There's no way to do this - what do you need it for?

Ciao
Frank

[1]http://api.openof
fice.org/docs/common/ref/com/sun/star/sdb/application/XDatab
aseDocumentUI.html

-- 
- Frank Schönheit, Software Engineer        
frank.schoenheitsun.com -
- Sun Microsystems                      http://www.sun.com/star
office -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )