on 12-07-2005 6:07 AM - last edited on 02-04-2024 12:55 AM by postmig_api_4
hi there,
i am having problem while inserting the time in to the database table.i m using java.sql.time .and my database is in oracle.if i enter the time using any format other than 10:09:05 AM then i get a <b>error message to insert in : : : format</b>. but if i do so then it throws sql error that sql error** <b>: is unexpected</b>.
please guide with ur valuable ideas.
thankx in advance.
You can use the following code to format time..
Time ff = new Time(System.currentTimeMillis());
SimpleDateFormat objdateformat = new SimpleDateFormat("K:mm:ss a");//will give u in the format as u said
wdContext.currentContextElement().setTime("Time = "+ objdateformat.format(ff));
Check if it is helpful
AD
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi AD
thankx for ur reply..actually the server where i used to deploy code is not working so cant try this right now..any way i will....but i have a doubt...i want the time to be entred by the user..not the current syatem time..like user setting some event to occur in future...what changes should i made for that in the code
thanx
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.