/** * Return the SQL connection associated with a DSLContext * @param context * @return the connection, or null. */ public static Connection getConnection(DSLContext context) { ConnectionProvider provider = context.configuration().connectionProvider(); if (provider instanceof DefaultConnectionProvider) { return ((DefaultConnectionProvider) provider).acquire(); } else { return null; } }