Statement statement = connection.createStatement();
String frmdate = request.getParameter("date1");
String todate = request.getParameter("date2");
SimpleDateFormat df = new SimpleDateFormat("DD/MM/YYYY");
//Date frmdate = df.parse("strdate1");
//Date todate = df.parse("strdate2");
try {
// java.util.Date date3 = df.parse(frmdate);
// java.util.Date date4 = df.parse(todate);
java.util.Date ufdate1 = df.parse(frmdate);
java.util.Date utdate2 = df.parse(todate);
java.sql.Date fs1 = new java.sql.Date(ufdate1.getTime());
java.sql.Date ts2 = new java.sql.Date(utdate2.getTime());
// java.sql.Date sqlDate1 = new java.sql.Date(date3.getTime());
// java.sql.Date sqlDate2 = new java.sql.Date(date4.getTime());
} catch(ParseException e) {
}
PreparedStatement p =connection.prepareStatement("select g.iduser as \" UserId \", b.btid as \" BTID \", E.idaccount as \"ACCOUNT \" ,F.acctdesc as \"ACC_NAME \", " +
"a.btfilerefno as \"FILEREFNO \", COUNT(A.btamount) as \"COUNT \", sum(a.btamount) as\" AMOUNT \", b.status as\" STATUS \"," +
"(select count(BTTOKEN1) from btfilerecmap where btfilerefno = a.BTFILEREFNO and BTTOKEN1 = '7') as \" RTGS\", " +
"(select count(BTTOKEN1) from btfilerecmap where btfilerefno = a.BTFILEREFNO and BTTOKEN1 = '8') as \" NEFT \" from btfilerecmap a, btfileinfo b, BTACCTMAP E, " +
" MSTACCOUNT F,mstuser g , admintxnunauthdata h " +
" where a.btfilerefno = b.filerefno and g.iduser = b.iduser and a.btfilerefno = h.keycolumn2" +
" AND B.btid=E.btid and E.idaccount=F.idaccount and " +
" trunc(b.datupload) between to_date('?','DD/MM/YYYY') and to_date('?','DD/MM/YYYY ')" +
" and b.status='COMPLETE' and h.token4 = 'F' " +
" group by btfilerefno, status,b.btid, g.iduser, e.idaccount,f.acctdesc order by b.btid ");
//p.setDate(1,fs1);
//p.setDate(2,ts2);
p.setDate(1, new java.sql.Date(fs1.getTime()));
p.setDate(2, new java.sql.Date(ts2.getTime()));
ResultSet resultset = p.executeQuery();
***********
getting error while retrving value reqyest urgent help..please..
ERROR C:\Blazix\jspdir\corporate_jsp.java:174: cannot find symbol
symbol : variable fs1
location: class desisoft_jsp_corporate_jsp1273297131154
p.setDate(1,fs1);
^
C:\Blazix\jspdir\corporate_jsp.java:175: cannot find symbol
symbol : variable ts2
location: class desisoft_jsp_corporate_jsp1273297131154
p.setDate(2,ts2);