打印本文 打印本文 关闭窗口 关闭窗口
Tomcat5.0.19与oracle8.1.7连接池配置指南
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2503  更新时间:2009/4/22 22:03:03  文章录入:mintao  责任编辑:mintao
            Statement stmt = conn.createStatement();

            ResultSet rst =

                stmt.executeQuery(

                  "select * from cc_tab_kucun");// cc_tab_kucun可以是任意一个表名

            if(rst.next()) {

               foo=rst.getString(1);

               //bar=rst.getInt(3);

            }

            conn.close();

        }

      }

    }catch(Exception e) {

      e.printStackTrace();

    }

%>

 <html>

  <head>

    <title>DB Test</title>

  </head>

  <body>

 

  <h2>Results</h2>

    Foo <%= foo %><br/>

    Bar <%=bar %>

 

  </body>

</html>

 

IE中输入http://localhost:8080/DBTest/DBTest.jsp,如果正常运行显示类似如下所示:

Results

Foo 3980
Bar –1

 

则说明成功。

上一页  [1] [2] [3] 

打印本文 打印本文 关闭窗口 关闭窗口