From: thhal at mailblocks.com (Thomas Hallgren) Date: Mon, 03 Oct 2005 07:25:04 +0200 Subject: [Pljava-dev] NPE using existing TriggerData ResultSet In-Reply-To: <43408B91.1080509@tokuii.com> References: <43408B91.1080509@tokuii.com> <4340C0B0.9030303@mailblocks.com> Message-ID: 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