• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

jdbc

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a date field in my database and two other date fields which are dependent on the first.
i have to calculate two dates using the first input date.
i have to calculate date after 3 months and 6 months.
i have used servlets as mediator.
i have used inbuilt functions like months after,and date+90(for three months)
eg:
if the user input 12-01-2001
i have to calculate 12-4-2001 and 12-7-2001
and insert in to table.
but i could not do it from the servlet.
can any one help in concern??
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the error
It may be due to database you are using
Usually databases expect date to be in their default format like in oracle 12-JAN-2001
So if you try to put the date in other formats it may give error
I hope I am right, may be there may be other causes for the error
Regards

[This message has been edited by narayan kulkarni (edited February 06, 2001).]
 
sachin_ckd
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am not getting any error but the values are not getting updated.
i am using Access 2000
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont think there should be any problem. You just add the date fields with required number of months,and insert into the database.I think the error is in the database.
By the way what error you are getting.Is there any problem in database connetivity
 
narayan kulkarni
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out the database format for the date in Access which you have specified
Access default format is I believe dd/mm/yy make
If you specify it as short date it may accept
Best thing would to debug would be to c&p the query you are executing in servlet in MS-Access query window and execute it
It would allow you to find whether the query is correct
There will be some sqlexception thrown in the webserver prompt
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"sachin_ckd",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.
Thanks.
 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic