// Get a set of JDBC connection pools for this Domain.
// Test whether the connection pool exists first and if it does, delete it.
Set connectionPools = mbeanHome.getMBeansByType("JDBCConnectionPool", mbeanHome.getDomainName());
Iterator iter = connectionPools.iterator();
System.out.println("Looping through all connection pools...");
while (iter.hasNext())
{
JDBCConnectionPoolMBean aConnectionPool = (JDBCConnectionPoolMBean)iter.next();
System.out.println(aConnectionPool.getName());
if (aConnectionPool.getName().equals(pNameOfConnectionPool))
{
this.deleteConnectionPool(aConnectionPool);
break;
}
}
// Create Connection Pool
myConnectionPool = (JDBCConnectionPoolMBean)mbeanHome.createAdminMBean(pNameOfConnectionPool, "JDBCConnectionPool", mbeanHome.getDomainName());
// Target the Connection Pool to the specified server.
myConnectionPool.addTarget(serverMBean);
System.out.println("Starting up connection pool.");
return myConnectionPool;
}
catch (Exception e)
{
throw new SQLException(e.toString());
}
}
//删除一个连接池
public void deleteConnectionPool(JDBCConnectionPoolMBean pConnectionPoolMBean) throws SQLException
{
System.out.println("Deleting Connection Pool...");
try
{
// Remove Connection Pool from the server
pConnectionPoolMBean.removeTarget(serverMBean);
// Remove Connection MBean from the configuration
mbeanHome.deleteMBean(pConnectionPoolMBean);
to johncdc
问题就是出在这里,当你的连接池连接不同的数据库时,这个密码是不同的,我就想知道这个密码是怎么生成的。我看了一下控制台的源代码程序,当你在控制台配好一个连接池,点击发布的时候是调了一个类。我不知道这个类在weblogic8中的什么位置。还有这个类有个接口参数,是一个url,这个url比较难懂,不知道什么意思。我可不可以在我得应用程序中调用这个类。具体该怎么办
to naxin:你说的j2ee中角色定义,是什么意思。我如何找到weblogic8是怎么定义的。