引用 websphere datasource
<resource-ref>
<description>Datasource</description>
<res-ref-name>jdbc/oracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
properties.put(Context.PROVIDER_URL, "iiop://localhost:2809");
Context ctx = new InitialContext(properties);
DataSource ds = (DataSource) ctx.lookup("jdbc/Oracle");
Connection conn = ds.getConnection();
out.println(conn + "<br>");
conn.setAutoCommit(false);
String query = "select sysdate from dual";
ResultSet rs = null;
PreparedStatement ps = conn.prepareStatement(query);
rs = ps.executeQuery();
while(rs.next()){
out.println((java.util.Date)rs.getDate(1) + "<br>" );
}
conn.commit();
rs.close();
ps.close();
conn.close();
JVM :应用服务器 -->server-->服务基础架构-->进程定义-->JVM 256 512
分享到:
相关推荐
WebSphere MQ配置.rar WebSphere MQ配置.rar WebSphere MQ配置.rar
Prentice.Hall.PTR.IBM.WebSphere.Deployment.and.Advanced.Configuration.Aug.2004.eBook-DDU.chm
IBM websphereMQ 8.0.0.5 lib包; IBM\WebSphere MQ\java\lib下的文件 文件列表: com.ibm.mq.jms.Nojndi.jar com.ibm.mq.pcf.jar com.ibm.mq.allclient.jar com.ibm.mq.postcard.jar com.ibm.mq.axis2.jar ...
websphere commerce的使用即websphere commerce图解.在网上扒了半天才找到的稀品啊!IBM创建商品店铺(websphere commerce).pdf 一些其他的相关资料: ...
Websphere实用手册.pdf
Websphere.Application.Developer(WSAD)使用外置WinCVS解决方案Websphere.Application.Developer(WSAD)使用外置WinCVS解决方案
IBM.Press.Getting.Started.with.IBM.WebSphere.sMash.Aug.2010.rar
非本人原创,网上找的,但是调试不成功,偶调试成功后放上去
websphere培训教程.pdf
美河提供.IBM.WebSphere.Studio.J2EE应用开发.
WebSphere快速入门.pdf
IBM.Press.Rapid.Portlet.Developme.with.WebSphere.Portlet.Factory.Sep.2008.pdf E文
websphere配置手册.doc ,供websphere 爱好者学习和参考。
WebSphere快速入门.doc
WebSphere培训教程.ppt
Prentice.Hall.PTR.IBM.WebSphere.Deployment.and.Advanced.Configuration.Aug.2004.eBook-DDU.chm
WebSphere项目部署.docxWebSphere项目部署.docx
WebSphere项目部署.pdfWebSphere项目部署.pdf
WebSphere内部培训.pptx