如何使用示例JDBCResourcesWithJMX代码在Websphere传统上创建Oracle数据源?

时间:2018-01-30 11:08:16

标签: websphere datasource

有没有人使用websphere JDBCResourcesWithJMX和oracle数据源?我无法为oracle数据源设置“url”参数,也找不到任何示例... 任何帮助将不胜感激.. 感谢..

1 个答案:

答案 0 :(得分:0)

在示例java源代码JDBCResourcesWithJMX中,您应该能够通过编辑源代码来设置Oracle数据源的URL属性:

// the attribute DataSource.relationResourceAdapter is required
// in addition to the attributes in the template
    AttributeList dsAttrs = new AttributeList();
    dsAttrs.add(new Attribute("name", dataSourceName));
// override some other props in the template
    dsAttrs.add(new Attribute("URL", "jdbc:oracle:thin:@//localhost:1521/sample"));
    dsAttrs.add(new Attribute("description", dataSourceName));
    dsAttrs.add(new Attribute("jndiName", "jdbc/" + dataSourceName));