pg.ddx.io  pljava-dev@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Subject: [Pljava-dev] NPE using existing TriggerData ResultSet
Date: Mon, 03 Oct 2005 07:25:04 +0200
Message-ID: <thhal-0NlkcBPu/8bQY+jtLwtI5eEtvnV7lQ4@mailblocks.com> (raw)
In-Reply-To: <43408B91.1080509@tokuii.com>
References: <43408B91.1080509@tokuii.com>
	<4340C0B0.9030303@mailblocks.com>
	<thhal-0NVkcBPm/8bQPcta3V5O3m1yH9eS2xt@mailblocks.com>

No, that's not a bug. There's no statement associated with the ResultSet 
obtained from TriggerData. The statement:

Connection conn = DriverManager.getConnection("jdbc:default:connection");

will always return the current (i.e. the existing postgresql) connection.

- thomas

kstian wrote:

> Hi,
>
> I was trying to use the existing postgresql connection from 
> TriggerData in Trigger function trying to write some data back to 
> postgresql (in another table) by using:
>
> public static void triggerFunction(TriggerData td)
> {
>  .
>  ResultSet _rsnew = td.getNew();
>  .
>  .
>  .
>  function(_rsnew.getStatement().getConnection());   //<========= (NPE 
> here)
>  .
>  .
> }
>
>
> private static function (java.sql.Connection conn)
> {
>  .
>  .
>  .
> }
>
> However, I am getting NPE at statement 
> "_renew.getStatement().getConnection()".
>
> Is this a bug? Do you have another solution to reuse existing 
> postgresql connection?
>
> Thanks a lot for helping.
>
> Regards,
> Kong
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/pljava-dev







view thread (2+ messages)

Message-ID: <thhal-0NlkcBPu/8bQY+jtLwtI5eEtvnV7lQ4@mailblocks.com>
Permalink:  ../thhal-0NlkcBPu%2F8bQY+jtLwtI5eEtvnV7lQ4@mailblocks.com/
Also on:    postgresql.org/message-id/thhal-0NlkcBPu/8bQY+jtLwtI5eEtvnV7lQ4@mailblocks.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] NPE using existing TriggerData ResultSet
  In-Reply-To: <thhal-0NlkcBPu/8bQY+jtLwtI5eEtvnV7lQ4@mailblocks.com>

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

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