Manoj Kumar
May 28th, 2001, 02:01 AM
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;
import java.sql.*;
import java.util.Date;
import java.util.*;
---------
----------------
-----------------------
String kuntry=req.getparameter("country");
String mem_id=req.getPatameter("cust_id");
Date today=new Date();
Date last_update;
Date update;
//check whether the client has downloaded the latest updates or not
Statement st1=conn.createStatement();
String query1="select OurUploadDate,CustomerDetails.LastUpdated from OurUpdateInfo,CustomerDetails where CustomerDetails.CustID='"+mem_id+"'";
ResultSet rs1=st.executeQuery(query1);
if(rs1.next())
{
last_update=rs1.getDate("LastUpdated");
update=rs1.getDate("OurUploadDate");
if(last_update==null) // IF LastUpdated FIELD IS BLANK
{
//codes to insert the update date and files downloaded
pw.println("before insert..."); // WORKING TILL HERE . THIS DISPLAY IS APPEARING
//NOT WORKING AFTER THIS
// NO MODIFICATION IN DATABASE TAKING PLACE
String inqry="update CustomerDetails set LastUpdated='"+today+"', Files_Downloaded='"+kuntry +"' where CustID='"+mem_id+"'";
Statement inst=conn.createStatement();
inst.executeUpdate(inqry);
// THIS IS NOT DISPLAYED ON SCREEN
pw.println("inserted into database");
inst.close();
KINDLY HELP .WHAT COULD BE THE REASON.IS THERE ANY INCOMPATIBILITY TAKING PLACE BETWEEN java.sql.Date and java.util.Date.
IF YES HOW DO I HANDLE IT SO THAT TEH DATE AS WELL AS THE STRING kuntry IS INSERTED IN THE DATABASE.KINDLY NOTE THAT THE LastUpdated field is set as date type/short format.
import javax.servlet.*;
import java.io.*;
import java.sql.*;
import java.util.Date;
import java.util.*;
---------
----------------
-----------------------
String kuntry=req.getparameter("country");
String mem_id=req.getPatameter("cust_id");
Date today=new Date();
Date last_update;
Date update;
//check whether the client has downloaded the latest updates or not
Statement st1=conn.createStatement();
String query1="select OurUploadDate,CustomerDetails.LastUpdated from OurUpdateInfo,CustomerDetails where CustomerDetails.CustID='"+mem_id+"'";
ResultSet rs1=st.executeQuery(query1);
if(rs1.next())
{
last_update=rs1.getDate("LastUpdated");
update=rs1.getDate("OurUploadDate");
if(last_update==null) // IF LastUpdated FIELD IS BLANK
{
//codes to insert the update date and files downloaded
pw.println("before insert..."); // WORKING TILL HERE . THIS DISPLAY IS APPEARING
//NOT WORKING AFTER THIS
// NO MODIFICATION IN DATABASE TAKING PLACE
String inqry="update CustomerDetails set LastUpdated='"+today+"', Files_Downloaded='"+kuntry +"' where CustID='"+mem_id+"'";
Statement inst=conn.createStatement();
inst.executeUpdate(inqry);
// THIS IS NOT DISPLAYED ON SCREEN
pw.println("inserted into database");
inst.close();
KINDLY HELP .WHAT COULD BE THE REASON.IS THERE ANY INCOMPATIBILITY TAKING PLACE BETWEEN java.sql.Date and java.util.Date.
IF YES HOW DO I HANDLE IT SO THAT TEH DATE AS WELL AS THE STRING kuntry IS INSERTED IN THE DATABASE.KINDLY NOTE THAT THE LastUpdated field is set as date type/short format.