Dashboard > Penrose 1.0 > ... > Embedding Penrose > Connection Manager
Connection Manager
Added by Endi S. Dewata, last edited by Endi S. Dewata on Feb 28, 2006
Labels: 
(None)


Penrose uses the connection manager to manage connections to the mapped data sources. Once you start Penrose, you can get the connection manager:

ConnectionManager connectionManager = penrose.getConnectionManager();

Then you can use the connection manager to open the actual connection by supplying the connection name as defined in connections.xml.

String connectionName = "ExampleDB";
Object object = connectionManager.openConnection(connectionName);

If the connection is a JDBC connection, you will get an SQL Connection object:

Connection con = (Connection)object;

If the connection is a JNDI connection, you will get a DirContext object:

DirContext ctx = (DirContext)object;

Site running on a free Atlassian Confluence Open Source Project License granted to Safehaus. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators