agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] pljava + http-post
Date: Sat, 20 Oct 2007 16:36:46 +0000
Message-ID: <81.208.36.82.470311689.1192898206@webmail.katamail.com> (raw)

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







view thread (4+ messages)  latest in thread

Message-ID: <81.208.36.82.470311689.1192898206@webmail.katamail.com>
Permalink:  ../81.208.36.82.470311689.1192898206@webmail.katamail.com/
Also on:    postgresql.org/message-id/81.208.36.82.470311689.1192898206@webmail.katamail.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] pljava + http-post
  In-Reply-To: <81.208.36.82.470311689.1192898206@webmail.katamail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox