I've been going round and round trying to get the LocalDataSource.getConnection(Project) method to not hang and give me a java.sql.Connection object. No dice. So, I spent quite a bit of time coming up with the following solution.
1. Create a custom UrlClassLoader instance with the jars from the LocalDataSource.
2. Retrieving the java.sql.Driver implementation from the new classloader
3. Instantiating the Driver implementation instance directly (since DriverManager.getConnection() can't find the Driver class in the custom ClassLoader)
4. Calling Driver.connect(String, Properties) directly.
5. Continuing on with the rest of my logic.
Is there something I'm missing here? Is it really that difficult to use the LocalDataSource to connect to the database?