Hello, what I'm trying to do is insert data into a database table. 'normal' info is inserted fine but what I need to do is have the current date inserted with the information also. There is a date field in the table but is there a method that allows the current date to be inserted with the rest of the info? Thanks!
See this as an example... I did it in oracle.... I hope it is applicable to other database as well, you change the function TO_DATE to corresponding function of database... Hope this helps...
Co-author of SCMAD Exam Guide, Author of JMADPlus SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Thanks again Ko, but now there's an error saying - "The type of this expression, "int", is not a valid reference type in this context." and it refers to the line - today.getDate().toString() Is it because I'm trying to assign the date to a string?
Originally posted by shuzo monsoon: Thanks again Ko, but now there's an error saying - "The type of this expression, "int", is not a valid reference type in this context." and it refers to the line - today.getDate().toString()
Try this...
Is it because I'm trying to assign the date to a string?
No, it means that we are changing the date object to be a string... Hope it's solved...
Co-author of SCMAD Exam Guide, Author of JMADPlus SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
and POOF! You're gone! But look, this tiny ad is still here: