List Info

Thread: Re: transporting non-UNO Java interfaces via the Java UNO bridge




Re: transporting non-UNO Java interfaces via the Java UNO bridge
user name
2007-06-13 03:06:07
Frank Schönheit - Sun Microsystems Germany wrote:
> Hi Stephan,
> 
>> The summary change did its job.  
> 
> fine 
> 
>> However, I have a hard time 
>> understanding exactly what this thread is about. 
Is the problem the 
>> following?  On Java side you have a UNO XConnection
reference to an 
>> object implemented in C++, and from that reference
want to obtain a 
>> reference to a Java java.sql.Connection object?  Is
that object already 
>> instantiated (which seems odd to me given the
relevant UNO object is 
>> implemented in C++), and if yes where (in the same
Java environment 
>> where you have the UNO XConnection reference?), or
would it be part of 
>> this issue to instantiate it on the Java side (out
of thin air)?
> 
> The XConnection, implemented in C++, is a
wrapper/extension for a
> java.sql.Connection. This JDBC connection is accessed
via JNI, the JVM
> is loaded in-process of OOo.
> 
> What Ray wants to do is to access the JDBC connection
object in his Java
> program, which knows the XConnection only.
> 
> But now that you asked for the "where" ... I
assume chances are really
> low as long as Ray's program doesn't run in the same
JVM, right?

Yes.  com.sun.star.lang.XUnoTunnel.getSomething could almost
be your 
friend (use Java serialization to transport the
java.sql.Connection 
instance), but for one getSomething returns a hyper instead
of an any 
(and you cannot encode arbitrary byte sequences in a hyper),
and for 
another I have no idea whether java.sql.Connection is
serializable to 
start with.

-Stephan

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


[1]

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