Hi Subu,

Answer to your Question (Assumption-date1 field is of type DATE):

public void Process(Connection conn) throws SQLException
{
        PreparedStatement pstmt = null;
        ResultSet rs =null;
        try
        {
            java.util.Calendar cal= new GregorianCalendar();
            cal.add(Calendar.DAY_OF_MONTH , 30);
            java.sql.Timestamp mdate = new
Timestamp(cal.getTime().getTime());
            pstmt = conn.prepareStatement("SELECT fieldnames FROM table
WHERE date1 >= ? ");
            pstmt.setTimestamp(1, mdate);
            rs = pstmt.executeQuery();
            while (rs.next())
            {
                //process here
            }
        }
        catch (Exception e)
        {
            //Process Exception OR throw e;
        }
        finally
        {
            if (rs != null)
            {
                try
                {
                    rs.close();
                }catch(Exception e2){}
            }
            if (pstmt != null)
            {
                try
                {
                    pstmt.close();
                }catch(Exception e2){}
            }
        }
}

I Hope this answers your question

Regards
Kishore



hi
    i want to check the datas date1 is a data entered date and date2
is the current sysdate.so date one is greate than 30 means i need to
fire some query how can i do it in jsp using  mssascess.

Thanks
subu
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
  • subu subramanian Athimoolam
    • Kishore Raghavan

Reply via email to