Subject Re: Java trigger & SP future....
Author Roman Rokytskyy
Hi,

> where can I get some information about using UDF to call java code
> via JNI.

I do not think that anybody have done this before. But the idea is simple:

a) make your Java code accessible from C/C++, good source of
information would be
http://java.sun.com/docs/books/tutorial/native1.1/invoking/index.html

b) create a UDF(s) that will call you C/C++ wrapper of you Java code.

Alternative:

a) try using gcc for Java to compile Java into native code
(http://gcc.gnu.org/java/)

> I'm using Jaybird. I would improve my system's perfomance.

I have no experience in embedding JVM into native applications, but
there are some good examples showing that it makes sense (for example,
Jim Starkey, original architect of InterBase/Firebird, had embedded
JVM in his new Netfrastructure engine). But this seems to be rather
complex task.

> Now I make a poll in orden to know whether something has happened in
> my db.
>
> Another question related: is there any way to use Firebird Database
> Events with Jaybird. It could be other possible solution for my
> problem.

Yes, correct way of solving your problem would be using Firebird
events. Unfortunatelly they are not yet available in JayBird.

If you are not afraid implementing this part of the API and would like
to contribute it to JayBird, we will try to help you and review your
code before adding it to the CVS. If you plan to contribute code on
regular basis, you will get write access.

Another solution for your problem would be to define a set of "events"
in the database and store information about them in some table.
Polling new "events" from that table should be fast enough (I think it
will be faster than invoking JVM).

Best regards,
Roman Rokytskyy