谁有struts1.1连接数据库简单的例子的代码 JSPStudio的模板是一个数据库例子。利用JSPStudio数据库应用文件向导可自动生成各种应用文件。ftp://210.36.70.51 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这里是一个成功的Struts 连接Oracle 的例子: <data-sources> <data-source type="org.apache.struts.util.GenericDataSource" key="OracleDS"> <set-property value="true" property="autoCommit" /> <set-property value="Example Data Source Configuration" property="description" /> <set-property value="oracle.jdbc.driver.OracleDriver" property="driverClass" /> <set-property value="5" property="maxCount" /> <set-property value="2" property="minCount" /> <set-property value="jdbc:oracle:thin:@192.168.17.254:1521:dbname" property="url" /> <set-property value="system" property="user" /> <set-property value="manager" property="password" /> </data-source> </data-sources>Struts Action中的perform或execute方法中: DataSource ds = servlet.findDataSource("OracleDS"); try { Connection conn = ds.getConnection(); PreparedStatement ps = conn.prepareStatement("SELECT * FROM user_tables"); ResultSet rs = ps.executeQuery(); session.setAttribute("rs", rs); while(rs.next()){ System.out.println(rs.getString(1) + " " + rs.getString(2) + " " + rs.getString(3)); } } catch (Exception ex) { ex.printStackTrace(); } finally { } ibatis sqlmap 在插入数据时乱码!请问怎么解决? 求 hibernate 取 最大 id 如何写。。。我写的出错晕 Struts 2 怎样实现三级联动呢。。? 如何用JDOM创建以下XML 高分求struts小型项目~~`有源代码`` servler中不能读取text类型的数据 xml解析的问题 想找个开源的OA用用,哪位知道?多多指点哦.重谢! 在JBUILDER9中用什么工具写EJB? 求助:关于Bean的发布问题,在线等待。。。 下面的代码哪儿错了?WebLogic7下的JDBC实例 哪位有一个最简单的关于struts的运用实例,最好有注释!
<data-source type="org.apache.struts.util.GenericDataSource" key="OracleDS">
<set-property value="true" property="autoCommit" />
<set-property value="Example Data Source Configuration" property="description" />
<set-property value="oracle.jdbc.driver.OracleDriver" property="driverClass" />
<set-property value="5" property="maxCount" />
<set-property value="2" property="minCount" />
<set-property value="jdbc:oracle:thin:@192.168.17.254:1521:dbname" property="url" />
<set-property value="system" property="user" />
<set-property value="manager" property="password" />
</data-source>
</data-sources>
Struts Action中的perform或execute方法中: DataSource ds = servlet.findDataSource("OracleDS");
try {
Connection conn = ds.getConnection();
PreparedStatement ps = conn.prepareStatement("SELECT * FROM user_tables");
ResultSet rs = ps.executeQuery();
session.setAttribute("rs", rs);
while(rs.next()){
System.out.println(rs.getString(1) + " " + rs.getString(2) + " " + rs.getString(3));
}
}
catch (Exception ex) {
ex.printStackTrace();
}
finally { }