This has always been my favorite way of doing it :
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ResultSet rs=....
java.util.Date d = sdf.parse(rs.getString(1));
The reason for the getString is because the time always get chopped off if you use getDate(). And I didn't want to use a getTimestamp() because I just wanted to deal with Date objects.
Hi,
I think i have made a wrong explanation for my query.My query is i would like to insert date value into MS SQL,but i don't want to key in value.For instance, i don't want to setString() or setTimeStamp(),i just want to automatically get the date value from MS SQL and insert it into table.Is it possible? Or i have to use method to do so.Sorry for my mistake.
Hello guys...
well may seem pretty funny... but my problem is what should i put in
DriverManager.getConnection(" WHAT SHOULD COME HERE.. !!! " )
I'm usind sun's driver to connect .. and not using any third party Bridge... i have never worked with MSSQL..( only worked with Oracle and MySql...!!!! )
please tell me what should be there in the expression above... it's pretty urgent...
and can anyone tell me about sending a mail from an applet... like an HTML mail... like on " SUBMIT " i want a mail to go out at a particular address... the mail's content are the values of the fields...and i would like to send it from an applet..
hope someone can helpe me on this... !!
thanks ..many a thanks...
premal
Hi,
I used JOptionPane.showInputDialog to let me insert the date value for my application,but after inserting into DB, i found that the date value is 1/1/1900 when i used datatime data type and the value is 0 when i used varchar data type,why?Is it because i didn't insert any value so MS SQL automatically put a value for me?
Hi,
I didn't try the printing that you mentioned,but last time i also used the same JOptionPane.showInputDialog method to insert date value,but the value that i inserted was defined as January,february...(string).but now i would like to try actual date value.
Can you please tell me do i need to create a date class?I set the value of date object first,then i get from the class.If yes,how do i write that class?
Really thanks for your help.