Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Development-process Error in Storing date
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Rajendra
Error in Storing date
1 Answer(s)      5 years and 5 months ago
Posted in : Development process



Advertisement
View Answers

June 1, 2009 at 2:36 PM


Hi Friend,

MS Access Database sets the date in DD/MM/YYYY format. Take field id of text type and date of date/time type.Then try the following code:

<%@page import=" java.sql.*, java.util.*"%>
<%
try{
Connection conn=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
conn = DriverManager.getConnection("jdbc:odbc:access");

Statement pstmt = conn.createStatement();
java.sql.Date sqlDate = new java.sql.Date(new java.util.Date().getTime());
String INSERT_RECORD = "insert into insertDate(id,myDate) values('5', '"+sqlDate+"')";
pstmt.executeUpdate(INSERT_RECORD);
pstmt.close();
conn.close();
}
catch(Exception e)
{
e.printStackTrace();
}
%>
Thanks


Related Tutorials/Questions & Answers:
Error in Storing date - Development process
Error in Storing date  Hi, U have given this code for storing date..., MS Access Database sets the date in DD/MM/YYYY format. Take field id of text type and date of date/time type.Then try the following code: Thanks
storing date from html form to oracle 10g using servlet
storing date from html form to oracle 10g using servlet  i have following html form from where date,month and year is retrieved separately.. <... this date month year from html form into oracle 10g database where i have
Advertisements
storing date from html form to oracle 10g using servlet
storing date from html form to oracle 10g using servlet  i have following html form from where date,month and year is retrieved separately.. <... this date month year from html form into oracle 10g database where i have
sorting and storing data
sorting and storing data   sorting and storing data in UITableView
storing csv into oracle database
storing csv into oracle database  i want jsp code for storing csv file into oracle database
Storing array in php
Storing array in php  How to store an array in PHP
JSF Date picker error - Java Server Faces Questions
JSF Date picker error  hi friend thanks for your... is the error on my code.here i have placed my code. Please kindly send me if there any mistakes happened.and i saw one error in my tomcat console. That error
iphone storing and fetching data
iphone storing and fetching data  How to store and fetch data in an iphone application
Uploading a Software and storing in the database
Uploading a Software and storing in the database  I want to upload a software(may be of maximum 20mb) through JSP, and store it in the database. The coding present in the site for uploading and storing in the database
Remote file storing in mobile
Remote file storing in mobile  Hai.. i want to do my semester project..i have selected a topic "Remote file storing in mobile"..it is in the form like any Java enabled GPRS based mobile phone users can store their images,video
Remote file storing in mobile
Remote file storing in mobile  Hai.. i want to do my semester project..i have selected a topic "Remote file storing in mobile"..it is in the form like any Java enabled GPRS based mobile phone users can store their images,video
storing xml into database - XML
storing xml into database   hi i have an xml file it contains elements with attributes as well as nested elements so how to go forward .......with it i know how to persist a simple xml file into data base but i m finding some
storing data into flat files
storing data into flat files  how can i retrive data from database and store data in flat files   Hi Friend, Try the following code: import java.io.*; import java.sql.*; import java.util.*; class StoreDataIntoFile
storing data in xml - XML
storing data in xml  Can u plz help me how to store data in xml using java  Hi Friend, Try the following code: import java.io.*; import java.util.*; import org.w3c.dom.*; import javax.xml.parsers.*; import
Storing and Reading data
Storing and Reading data   Hello, I'm developing a GUI application as part of an assignment but stuck on how my program stores and reads the data the user entered into the GUI table I created. I also wanted to apply a java code
date
date   how to insert date in database? i need coding
Reading Text file and storing in map
Reading Text file and storing in map  Hi I have multiple text files. I want to read thoses files and store those records in map. Map will be of "LinkedHashMap<String, Map<String, String>>" type. Please let me know
date
date  i want difference between the date entered in a jtextfield and the system date in java
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
database table name birthday (DOB date); dob with DATE data type in database while...=d.getTime(); java.sql.Date date = new java.sql.Date(t); try { System.out.println(date); Class.forName("oracle.jdbc.OracleDriver"); con
DATE
DATE  I have the following as my known parameter Effective Date... of calcultion starts My question is how to find the date of Thursday This cycle... the date of all the thursdays of the given year. import java.util.*; import
Why string is storing null value - IoC
Why string is storing null value  I am reading lines from a file...! then it is storing it in a temp variable.... but when i am running the program it is also storing null value in temp. WHY so
to fetch data from ms word and storing into database
to fetch data from ms word and storing into database  i want to know how to fetch datafields from ms word and storing into database??? please answer soon .its urgent
jsp code for storing login and logout time to an account
jsp code for storing login and logout time to an account  I need simple jsp code for extracting and storing login and logout time in a database table..plz someone help me...   Please visit the following link: http
Storing the Color Image pixel values into 2d array
Storing the Color Image pixel values into 2d array  i want to store the color image pixel values into 2d array and agiain the array have to store into a text file using java... plz provide the code
extracting phone number n storing in excel
extracting phone number n storing in excel  i need a program to open a doc file n extract phone numbers from it and store it in a excel sheet?? plz do reply and help me out with the problem
 

 

 

DMCA.com