日期:2014-05-17 浏览次数:20662 次
<sql:query var="total" dataSource="jdbc/ds"> select COUNT(*) from tb_airinfo </sql:query>
<% int count = 0; Connection con = null; Context context = new InitialContext(); DataSource ds = (DataSource)context.lookup("java:comp/env/jdbc/ds"); con = ds.getConnection(); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select COUNT(*) from tb_airinfo"); while(rs.next()){ count = rs.getInt(1); } con.close(); %>