<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><%@page
language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<jsp:useBean id="db" class="database.db"></jsp:useBean>
<%@ page import="java.awt.*" %>
<%@ page import="java.io.*" %>
<%@ page import="org.jfree.chart.*" %>
<%@ page import="org.jfree.chart.axis.*" %>
<%@ page import="org.jfree.chart.entity.*" %>
<%@ page import="org.jfree.chart.labels.*" %>
<%@ page import="org.jfree.chart.plot.*" %>
<%@ page import="org.jfree.chart.renderer.category.*" %>
<%@ page import="org.jfree.chart.urls.*" %>
<%@ page import="org.jfree.data.category.*" %>
<%@ page import="org.jfree.data.general.*" %>

<%@page import="java.sql.*" import="java.util.*"%>
<html>
<head>
<title>piechart</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<%
String mname=request.getParameter("mname");

[B]db.connect();
ResultSet rs;
int rs1;
try
{
rs=db.execSQL("SELECT AMOUNT,DATE,BILLNO FROM DB.EXPENSE WHERE MNAME='"+mname+"'");
WHERE MNAME='"+mname+"'");
if(rs.next())
{
double amt=rs.getDouble("amount");

System.out.println("amount is"+amt);
double d[][]=new double[][]{
{amt},
{rs.getDouble("BILLNO")}
};//double forms as a data set for the barchart
String date=rs.getString("DATE");
System.out.println("date is "+date);



/

final CategoryDataset dataset = DatasetUtilities.createCategoryDataset("test",date ,d);
//final CategoryDataset dataset = DatasetUtilities.

JFreeChart chart = null;
BarRenderer renderer = null;
CategoryPlot plot = null;

final CategoryAxis categoryAxis = new CategoryAxis("date");//X AXIS
final ValueAxis valueAxis = new NumberAxis("amt");//Y AXIS
renderer = new BarRenderer();
plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
plot.setOrientation(PlotOrientation.VERTICAL);
chart = new JFreeChart("mess expenses", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
chart.setBackgroundPaint(Color.WHITE);

Paint p1 = new GradientPaint(0.0f, 0.0f, Color.YELLOW, 0.0f, 0.0f,Color.PINK);
renderer.setSeriesPaint(1, p1);

Paint p2 = new GradientPaint(0.0f, 0.0f, Color.YELLOW, 0.0f, 0.0f, Color.PINK);
renderer.setSeriesPaint(2, p2);

plot.setRenderer(renderer);

try {
final ChartRenderingInfo info = new ChartRenderingInfo
(new StandardEntityCollection());
final File file1 = new File("C:/Users/TGMC/Desktop/Raghu/WebContent/Images/barchart.png");
ChartUtilities.saveChartAsPNG(file1, chart, 600, 400, info);
} catch (Exception e) {
out.println(e);
.................................................. ...........
The code runs perfectly and i am getting the barcode chart but the problem is RESULT SET rs POINTS THE SAME VALUE IN THE DATABASE

FOR EX:
FIRST VALUE IS 10000
AND SECOND VALUE IS 20000
AND THIRD VALUE IS 30000
The output comes as 3 barcodes for 10000 is marked and i need to get different values..........where i have gone wrong
do help me Thanks in advance