Welcome to the pl/JX hack

Have You ever wanted to do something like

	CREATE FUNCTION hello(int4) RETURNS text
	AS ' System.out.println("hello world"); 
	return "my favourite number is "+arg0; '
	LANGUAGE 'pljava';
Well, then You have come to the right place.

The last two evenings I hacked together a collection of bugs which will enable You to do nice things with PostgreSQL and Java. You are welcome to try it, but be aware, it is nothing but a hack.

How it works: (Don't expect UML diagrams here, they'll come after final release...)

  1. There is a handler written in C, which processes the args and writes then to some stream.
  2. On the other end of the stream there is a small Server which starts a Thread to process the call.
  3. In this thread the call is parsed, prepared for execution, run, and the result passed back.
Yes, its that easy. NOTE: It will most probably not work for You.

I know. Don't despair, wait for the release (sometime next year :)) or hack it to Your needs. This is work in progress and I put it up just to draw Your attention to the fact that there is something like this on the net.