我正在尝试以编程方式删除我在 JBoss 7 中创建的数据源。
创建它很容易...
ModelNode request = new ModelNode();
request.get(ClientConstants.OP).set(ClientConstants.ADD);
request.get(ClientConstants.OP_ADDR).add("subsystem",
"datasources");
request.get(ClientConstants.OP_ADDR).add("data-source",
dataSourceName);
request.get("jndi-name").set(dataSourceName);
request.get("pool-name").set(poolName);
request.get("use-java-context").set(Boolean.TRUE);
request.get("connection-url").set(url);
request.get("driver-name").set(driver-name));
request.get("min-pool-size").set(.minPoolSize);
request.get("max-pool-size").set(maxPoolSize);
request.get("user-name").set(username);
request.get("password").set("password");
ModelControllerClient client = ModelControllerClient.Factory.create(
InetAddress.getByName(LOCALHOST), 9999);
client.execute(new OperationBuilder(request).build());
client.close();
我的standalone.xml 创建并启用
...
<subsystem xmlns="urn:jboss:domain:datasources:1.1">
<datasources>
<datasource jndi-name="name" pool-name="poolName" enabled="true" use-java-context="true">
<connection-url>*url*</connection-url>
<driver>driver</driver>
...
</datasource>
<drivers>
<driver...>
...
</driver>
</drivers>
</datasources>
</subsystem>
...
但是...我找不到如何以编程方式删除它。有谁能够帮我?
谢谢 :)