Skip to content

Instantly share code, notes, and snippets.

@sergiomichels
Created March 14, 2013 00:03
Show Gist options
  • Select an option

  • Save sergiomichels/5157676 to your computer and use it in GitHub Desktop.

Select an option

Save sergiomichels/5157676 to your computer and use it in GitHub Desktop.
Controller that uses the UserCredentialsDataSourceAdapter
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()
}
}
@Pereitor

Copy link
Copy Markdown

I cannot get this to work. What's the import for Connection type??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment