In Cayenne 3.1 it is rather trivial:
ServerRuntime runtime = .. // this exists in every app
DataSource ds = runtime.getDataSource("MyDataNode");
In the earlier versions it is only marginally harder:
DataDomain dd = context.getParentDataDomain();
DataSource ds = dd.getDataNode("MyDataNode").getDataSource();
The last approach works on 3.1 too BTW.