I actually tried to count the number of rows in a tablet to get the value.
like this
if(ae.getActionCommand()=="Add")
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
conn = DriverManager.getConnection("jdbc:odbc:addissue","library", "adeeb");
stmt
=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
rs = stmt.executeQuery("SELECT * FROM addissue");
rs.last();
int num = rs.getRow();
System.out.println("Number of Rows = "+num);
}
catch(Exception e)
{
System.out.println("Error " + e);
}
Now i wanted to get the number of rows of particular value in a column using the same Syntax but only changed query like this
"rs = stmt.executeQuery("SELECT COUNT(*) FROM addissue WHERE rollno = 1201");"
now i get the answer i.e num = 1, because this query returns only one row. I know that, but the actual count of rows is different
Now are you clear.
Thanks for Replying My Question.
[ June 10, 2008: Message edited by: adeeb alexander ]
[ June 10, 2008: Message edited by: adeeb alexander ]