如何配置resin3.0? 帮你顶,resin3.0的配置好象与resin2.1x的配置有很多不一样噢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果你在一般的java application中调用你的DB2配置成功的话,resin应该是不用再配置了。我这只有它的连接测试的代码(应该要下个DB2的JDBC驱动):三、jsp连接DB2数据库 testdb2.jsp如下: <%@ page contentType="text/html;charset=gb2312"%> <%@ page import="java.sql.*"%> <html> <body> <%Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance(); String url="jdbc:db2://localhost:5000/sample"; //sample为你的数据库名 String user="admin"; String password=""; Connection conn= DriverManager.getConnection(url,user,password); Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); String sql="select * from test"; ResultSet rs=stmt.executeQuery(sql); while(rs.next()) {%> 您的第一个字段内容为:<%=rs.getString(1)%> 您的第二个字段内容为:<%=rs.getString(2)%> <%}%> <%out.print("数据库操作成功,恭喜你");%> <%rs.close(); stmt.close(); conn.close(); %> </body> </html> 希望对你有点帮助! 找到支持jdbc与db2相连的包,装到resin的lib目录下 http://www.csdn.net/develop/article/19/19187.shtm 求助!新创建的web工程里没有index.jsp文件,是神马情况? 请问大家forwards the request是什么意思。。。 ajax插入select 很急的问题,大家快帮忙啊 怎样用session来限制用户对页面的访问? jsp 串口 jsp发送邮件出错 高分求教,Applet如何访问远端资源啊(访问xml文件) 求一套jsp开发得聊天室程序 这是真的吗??“j2ee开发效率低,开发周期长;要求硬件水平高,运行效率低;部署困难,容易出错,维护成本高。” 有关一个在线调研的问题! 一个Applet的怪问题
三、jsp连接DB2数据库
testdb2.jsp如下:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance();
String url="jdbc:db2://localhost:5000/sample";
//sample为你的数据库名
String user="admin";
String password="";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="select * from test";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()) {%>
您的第一个字段内容为:<%=rs.getString(1)%>
您的第二个字段内容为:<%=rs.getString(2)%>
<%}%>
<%out.print("数据库操作成功,恭喜你");%>
<%rs.close();
stmt.close();
conn.close();
%>
</body>
</html>
希望对你有点帮助!