resultset « Date « Java Database Q&A





1. conflict with java.util.Date and java.sql.TimeStamp    stackoverflow.com

I am facing a unique problem. I am querying a database field which has a datatype (in oracle) as DATE . I am retrieving the value from resultSet as rs.getObject("myDate") . ...

2. using the date type in java    stackoverflow.com

I am trying to get two dates from a SQL query, and compare them. So to compare them, I believe I will need to use the "Date" type. ...

3. Resultset based on current Date and Time    coderanch.com

Hi I want to show Date and one field value from database in a drop down. I am using jstl for this in my jsp page. My query is like this: select product_name from Product where production_timestamp > to_date('2005-10-25 00:00:00','yyyy-MM-dd hh24:mi:ss') and production_timestamp < to_date('2005-10-25 23:59:59','yyyy-MM-dd hh24:mi:ss') I have to show the products produced for a particular day. The query has ...

5. NullPointerException for the Date field in ResultSet    coderanch.com

Hi Guys, I have to get the value from the first record in the ResulstSet for Date field in jsp. I have to print a message in jsp if the date field is null but it throws NullPointer Exception and I see the message in server console that I have written in catch block. Can you please help me with this? ...

6. ResultSet.getDate() retrives only Date Information but no Time Information    coderanch.com

Hi, I have a very generic Code to Copy the data from One Database to another Database with same schema. String sql = " select * from " + srcDBName + "." + tableName + ""; rs = st.executeQuery(sql); int columnCount = rs.getMetaData().getColumnCount(); Date date = null; SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); for (int currColumnIndex = 1; currColumnIndex <= columnCount-1; ...