on 03-14-2009 1:24 PM
Hi All,
please help me in this,
in my application i am using one method which expecting java.sql.date value,
here u can see the code.
java.util.Date utilDate = new java.util.Date(); //current date
java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());// current date to sql date convertion
DateFormat sdDate = new SimpleDateFormat("yyyyMMdd");// i need date in this format
String docdat = sdDate.format(sqlDate);
in this method i cant pass directly docdat string value i need to pass sqlDate value.
wdContext.currentZib_File_Input_CustCntrlElement().set_Load_Date(here sqlDate value i shud pass);// this method is expecting java.sql.date
please help in this,
thanks in advance
sush
Hi,
Are you formatting the date for your display purpose.
If it is for your display purpose then take a string attribute and display it.
And send the sqlDate to the backend.
But there is a problem here if the backend attribute is of type DATS and ur front end context attribute is of type date.
Then when ur pasing the date to the backend
Ex:-03/11/2009.
/ will also be considered and backend will only take upto 03/11/20.
Only will be taken. 08 will be left.
Since the length of DATS attribute is 8.
Thanks & Regards,
Lokesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sushma,
Your problem is that you need a java.sql.Date value to pass to your context attribute. Date formatting is helpful when you want to print a date. If your context attribute is a date (not a String), you do not have to deal with Date formatting. The type java.sql.Date knows nothing about date formatting (just and object representing a date) and this type is the type of the context attribute you have to feed. If you want to show date in the format "yyyyMMdd", you have to define you when you get the value from context attribute.
Hope it helps,
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.