getCurrentUser in spring

I have created a custom datasource bean I want to execute some query's in the datasource wich use the username of the one calling the datasource. I dont want this to happen in the jrxml file! but in the datasource.


Is there a "user" bean wich i can add to the factory when the datasource is called, or could I solve this in a other way?


thanks in advance,

Niels
Grazy Mos's picture
456
Joined: Sep 12 2006 - 11:13pm
Last seen: 17 years 3 weeks ago

1 Answer:

Try:

SecurityContextHolder.getContext().getAuthentication();



Sherman
JasperSoft
swood's picture
24557
Joined: Jun 21 2006 - 12:48pm
Last seen: 10 years 11 months ago
Feedback
randomness