From: Fred T. <fr...@us...> - 2012-01-07 11:02:25
|
This is covered in the Guide under "Trigger Action in Java" in this chapter. http://hsqldb.org/doc/2.0/guide/triggers-chapt.html "If the trigger needs to access the database, the same method as in Java Language Routines SQL/JRT can be used with "jdbc:default:connection" to get the connection to the database." In other words, you create a connection to this URL in your trigger code. This connection will have the properties of the original connection to the database and can be used to access the user or objects in the database. Java triggers are used only in situations where SQL triggers cannot be used. If you can perform the trigger actions with SQL statements, it is better to use SQL triggers. Fred On Fri, Jan 6, 2012, at 21:27, Armin Weiser wrote: > I need to log changes that are made in an HSQL Server database. > Therefore I need to find out the username of the user that is doing > the changes. How can I achieve this? There is no Connection object > within a trigger as far as I know. Any idea? > > Regards, Armin. > > ---------------------------------------------------------------------- > -------- > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a > complex infrastructure or vast IT resources to deliver seamless, > secure access to virtual desktops. With this all-in-one solution, > easily deploy virtual desktops for less than the cost of PCs and save > 60% on VDI infrastructure costs. Try it free! > http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Hsqldb-user mailing list Hsq...@li... > https://lists.sourceforge.net/lists/listinfo/hsqldb-user > |