cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Borut BolĨina <borut.bolc...@gmail.com>
Subject Which database am I connected to?
Date Fri, 17 Dec 2010 14:02:58 GMT
Hi,

sometimes when creating administrative web applications you want to show to
which database the application is connected to. For a simple case one can
do:

String connectionInfo  = ((DataContext)
dc).getParentDataDomain().getNode("MyNode").getDataSource().getConnection().toString();

and then parse out the info needed to display.

Would you consider forming a simple API for getting connection info out of
Cayenne context in future versions? Or am I just lazy? :-)

-Borut

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message