|
-
Jul 21st, 2003, 03:53 AM
#1
Thread Starter
New Member
Display output
My query to display total according to the type of particular product is as below:
String query = "SELECT COUNT(Type) FROM Sales " +
"GROUP BY Type DESC" ;
JOptionPane.showMessageDialog(null,"Sending Query....Please wait");
ResultSet rs = statement.executeQuery(query);
display(rs);
JOptionPane.showMessageDialog(null,"Query Succcessful !!!");
statement.close();
Above codes inside try{}.
Now how can i display it in a particular textArea(displaySales)..??..My display method is as below..:
public void display(ResultSet rs){
try{
rs.next();
int recordNumber = rs.getInt(1);
if (recordNumber !=0){
DisplaySales.append(Integer.parseInt(recordNumber));// DISPLAY PART...BUT GOT ERROR..!!
rs.next();
}// if
else
JOptionPane.showMessageDialog(null,"Record Not Found !!!");
}//try
catch (SQLException sqlex){
sqlex.printStackTrace();
System.out.println(sqlex.toString());
}//catch
}//display
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|