MySQL Forums
Forum List  »  Triggers

java and mysql to share user of an aplication
Posted by: hemer figueroa
Date: November 11, 2011 10:58PM

I'm using audit by triggers on a table as follows

CREATE TRIGGER add_Xtable
AFTER INSERT ON Xtable

FOR EACH ROW BEGIN
V_id_audit DECLARE, DEFAULT INT v_id_programa 0;

INSERT INTO audit VALUES (null, 'Xtable', USER(), now(), 'I');

however, the web application is built in Java and uses a connection pool, there is some way to get the java application user that is performing the transaction?
for example

INSERT INTO audit VALUES (null, 'program', CURRENT_JAVA_USER (), now (), 'A');

is that possible?

Options: ReplyQuote


Subject
Views
Written By
Posted
java and mysql to share user of an aplication
1463
November 11, 2011 10:58PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.