Created
March 14, 2013 00:03
-
-
Save sergiomichels/5157676 to your computer and use it in GitHub Desktop.
Controller that uses the UserCredentialsDataSourceAdapter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyController { | |
| def dataSource //instance of UserCredentialsDataSourceAdapter | |
| def index() { | |
| dataSource.setCredentialsForCurrentThread("user", "password") | |
| //this will call getConnection("user","password") | |
| //If we have a service, it will use the same username and password also | |
| Connection conn = dataSource.getConnection() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I cannot get this to work. What's the import for Connection type??