So following on my initial question, do we have an API for getting a JDBC connection from an existing XConnection? If there is none, I presume that we can write a JDBC implementation as a wrapper around the XConnection. A quick search on google did not allowed me to find an existing wrapper. Is anyone aware of such attempt?
Thanks, Martin Le 02/07/16 à 23:55, Carl Marcum a écrit : > On 07/01/2016 12:07 PM, Martin Desruisseaux wrote: >> Hello all >> >> I'm writing an OpenOffice add-in for Calc in Java as part of Apache >> Spatial Information System (SIS) project. I would like to access a >> database registered as an OpenOffice data source through the JDBC API. I >> see how to obtain a com::sun::star::sdbc::XConnection [1] from >> OpenOffice database context by following the developer guide [2]. I can >> see how I could use XConnection and related interfaces (XStatement, >> etc.) as their design seems similar to JDBC. But I need to access the >> database through java.sql.* interfaces rather than the >> com.sun.start.sdbc.* ones, for use with an existing Java library (namely >> Apache SIS). So I would like to know: >> >> * If a com::sun::star::sdbc::XConnection is connecting to a database >> using the "jdbc:" protocol, can we get the underlying >> java.sql.Connection? >> * If the answer to above question is "no", do we have wrappers >> somewhere that allow me to use a XConnection as if it was a >> java.sql.Connection? >> >> As a bonus, it would be nice if OpenOffice configured a JNDI environment >> for applications running in the JVM started by OpenOffice. That JNDI >> environment would give access to the OpenOffice data sources in the form >> of javax.sql.DataSource. I could volunteer for this part if there is >> interest. >> >> Regards, >> >> Martin >> >> [1] >> https://www.openoffice.org/api/docs/common/ref/com/sun/star/sdbc/XConnection.html >> [2] >> https://wiki.openoffice.org/wiki/Documentation/DevGuide/Database/Connecting_Through_a_DataSource >> > Hi Martin, > > 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? > > Thanks, > Carl --------------------------------------------------------------------- To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org For additional commands, e-mail: api-h...@openoffice.apache.org