[Pljava-dev] pljava + http-post

From: mechwarrior at katamail(dot)com (mechwarrior at katamail(dot)com)
To:
Subject: [Pljava-dev] pljava + http-post
Date: 2007-10-20 16:36:46
Message-ID: 81.208.36.82.470311689.1192898206@webmail.katamail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Hello evrybody,
i'm quite new to both postgresql and pljava and thus i'm having some problems to make my pljava function work.

I've a table with a trigger on it that call my pljava function. The function do some queries using the pljava jdbc and finally POST some data to a jsp page running on a resin webserver that is on the same pc where the postgresql db is running. The jsp page itself just read the data and insert it into another table on the same db.
I've tested the jsp page using another html page that pass the data through a form and it get inserted correctly into the db.
The trigger function seems to work correctly because i print(insert) some debug lines into a debug-table and the execution flow is correct.

To post my data from the trigger function i use this piece of code :

URL url = new URL("http://localhost:8080/catchxml/prova.jsp");
HttpURLConnection urlcon = (HttpURLConnection)url.openConnection();
urlcon.setDoOutput(true);
urlcon.setDoInput(false);
urlcon.setUseCaches(false);
urlcon.setRequestMethod("POST");
urlcon.setRequestProperty("Content-length", String.valueOf(data.length()));
OutputStreamWriter wr = new OutputStreamWriter(urlcon.getOutputStream());
wr.write(data);
wr.flush();

everything wrapped in a try/catch block that printout any generic exception.
It seems to work, because if the webserver isnt running i get an exception while trying to create the httpconnection. But, even if the write/flush doesnt give any error, my jsp page doesnt recive any data.

I also tryed to use the javau statement but nothing changed.

Any suggestion ?
I could really use some help.

________________________________________________________________________
SERVIZIO VOICE: TELEFONA e INVIA SMS dal tuo computer a tariffe vantaggiose!
Scopri come telefonare e videochiamare gratis da pc a pc.
http://voice.repubblica.it

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Kris Jurka 2007-10-22 07:25:50 [Pljava-dev] pljava + http-post
Previous Message Quan Zongliang 2007-10-20 04:23:43 [Pljava-dev] could not load library "C:/Program Files/PostgreSQL/8.2/lib/pljava.dll"