websphere jacl

(Websphere/appserver/profiles/appserver01/bin/wsadmin),编写jacl脚本,集成到ant中,利用ant强大的项目构建能力,简化测试、部署工作。下面的描述都是以我们自身项目为例,更加详细的内容请参考was6 information center(http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.Websphere.express.doc/info/welcome_express.html)

//首先根据数据源名称获取指定的数据源
DataSource dataSource = DataSourceHelper.getDataSource("dataSourceName");
//通过获取的数据源,获取数据连接
Connection connection=dataSource.getConnection();
//设置当前数据源连接手动提交事务
connection.setAutoCommit(false);
// 通过数据库连接获取当前数据库连接会话
IDASSession  session=DASManager.createDasSession(connection); 
//通过session可以操作数据库,增删改查API见下图
session.expandRelation(dataObject, lazyProperty);

 

猜你喜欢

转载自jdkleo.iteye.com/blog/2017185