开发者

database problem

In the code given below i m not getting any output. if i give that connection success statement i get that but not getting the count. Pls help me

<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%

try
{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con = DriverManager.getConnection("jdbc:odbc:ge","ge","ge");
Statement st=con.createStatement();
//String sql=("select count(*) from employees where status='Present'");
//out.println("Number of present days"+sql);
ResultSet rs = null;

rs = st.executeQuery("select count(*) from employees where status='Present'");
//out.println("connection success");

st.executeQuery("select count(*) from employees where status='Present'");

con.close();

}

catch(Exception e)
{
out.println(开发者_开发问答""+e);
}

%>


You need to print it

int rowcount = resultSet.getInt(1);  
out.println(i);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜