| package example.mysports.admin.services.glassfish; |
| |
| import javax.ws.rs.core.MediaType; |
| |
| public class DatasourceOperations extends RESTOperations { |
| |
| public DatasourceOperations(String server) { |
| super(server); |
| } |
| |
| public String getJDBCResources() { |
| return get("/domain/resources/list-jdbc-resources", MediaType.APPLICATION_JSON); |
| } |
| |
| public String getJDBCResource(String name) { |
| return get("/domain/resources/jdbc-resource/" + name.replace("/", "%2F"), MediaType.APPLICATION_JSON); |
| } |
| |
| public static void main(String[] args) { |
| DatasourceOperations ops = new DatasourceOperations("localhost"); |
| |
| String jdbcResources = ops.getJDBCResources(); |
| System.out.println(jdbcResources); |
| |
| String mysportsResource = ops.getJDBCResource("jdbc/MySportsZ"); |
| System.out.println(mysportsResource); |
| |
| } |
| |
| } |