Home Answers Viewqa Development-process Error in Storing date

 
 


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

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 Pages:
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
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
date - Date Calendar
date   hi, sir i am doing student details project in swing but i am not getting current date in jtextfield in date it is giving ambigious error... label=new JLabel("Current Date: "); JTextField text=new JTextField(15
Produces XML file but format not correct for storing data using JSP and XML
Produces XML file but format not correct for storing data using JSP and XML  hii I have created a project using JSP and XML as database to store data... the following error also: XML-22900: (Fatal Error) An internal error condition occurred
Date prorblem
)+"'}); when date filed DATEADDED is blank, I am getting the error...Date prorblem  HI all, i have date comming from one text file into string filed in java code. once the date is available in filed ( of type String
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
Storing properties in XML file
Storing properties in XML file     .... These are some of the methods used in code given below for storing properties...  * Date:-10-Jun-2008  
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
Multi-Date Handling Problem
Multi-Date Handling Problem  In our project we are using Oracle 10g as our data base, the problem is that we are picking In-date & Out-date from a calendar and on the basis of that date we are checking that on that date some
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
SQl Date
for storing a date or date value in database is given as:  ... SQL Date       The SQL Date is used when you are working with dates. This include
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
Getting Computer Date in java
but this.. String strDate = new Date(); I get this server error, "The type Date is ambiguous". I've also tried Date date = new Date(); ... but it get's the same error...Getting Computer Date in java  Hi , I want to get the PC Date
date_parse
, or FALSE on failure. An error message will display if date format faces any error. Description on Date Parse Format in PHP array date_parse ( string $date...date_parse() in PHP date_parse function returns associative array
php inserting date into mysql
php inserting date into mysql  php inserting date into mysql   Here is a php code that inserts date into mysql database. In the given code... (dp_name, dp_date) VALUES ('DATE: Manual Date', '2020-2-14')"; $query_auto
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
Submit Error - WebSevices
Submit Error  Hello, Tell me the procedure for Storing Hidden values in one Iframe. Send the exact code for this problem
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
Parsing into date object
Parsing into date object  Here is my code: String de = (String..."); Date d=new Date(); out.println(d); Date toDt; int oneDay = 24*60*60*1000; toDt.... But, it is showing error at the line where i performed parsing operation. Please help me
Parsing into date object
Parsing into date object  Here is my code: String de = (String..."); Date d=new Date(); out.println(d); Date toDt; int oneDay = 24*60*60*1000; toDt.... But, it is showing error at the line where i performed parsing operation. Please help me
Applet ... - Date Calendar
timerThread; Date date = new Date(); public void start... e){ System.out.println("error found" + e); } } } // Display the time public void paint(Graphics g) { g.drawString("Date"+new
Displaying Date in jsp - JDBC
Displaying Date in jsp  I want to insert Date of birth of a person... to interact with database.My JSP code for inserting Date is below: String dateStr... SimpleDateFormat("dd-MM-yyyy "); Date result = formater.parse(dateStr
Date Java - Java Beginners
Date Java  I'm using the eclipse software and I get an error for my...: public class Date { private int month; // 1-12 private int day; // 1-31... for day. public Date( int theMonth, int theDay, int theYear ) { if ( theMonth
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
Insert Date using Statement - Development process
Insert Date using Statement   Hi, plz send me code for Storing system date using statement instead of preparedstatement. Thanks Prakash  Hi Friend, Try the following code: Thanks
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  i want difference between the date entered in a jtextfield and the system date in java
jsp - Date Calendar
JSP page load error  Hi, I am getting error while loading the page in JSP. What could be the possible reason anyone
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
java date - Java Beginners
,"Incorrect login or password","Error",JOptionPane.ERROR_MESSAGE); text1.setText... is "login" the name,date,time is automaticaaly inserted into the database . My doubt is iam storeing system date and system time but i want to store i server
Getting Error - Development process
Getting Error   Hi , i am getting error while executing this code. I just want to store date in to database. Dont mistake me for repeated questions... fields id : number myDate : Date/Time Service_no : Number UserName : Name
The PHP Date() Function
The PHP Date() Function The PHP date() function is used for formatting the date and time. It formats a timestamp (a sequence of characters representing the date and/or time at which a certain event occurred) to make more readable
java date selector ..
java date selector ..  hey,,,, i am creating my java project...for that i implementing a car renting system and i had used combo boxes to get Ranting... handling code here: } //and am geting this error please help me Exception in thread
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
SQL QUERY ERROR
SQL QUERY ERROR  Im writing a query which shows error of INVALID..._NAME,PMSDT_DOB_DATE,PMSSTR_GENDER,PMSNUM_DESIGNATION_CODE,PMSNUM_CDAC_EMPID..._QUALIFICATION,PMSDT_ANNIVERSARY_DATE,PMSDT_JOINING_DATE,PMSNUM_RELIEVE_DATE,PMSSTR_IP
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
java compilation error - Ant
java compilation error  hi, i have a application in which i m reading from an xml file and then storing its values in database.but when i started using ant its main program is not running as it is unable to detect the jar file
Retrieve Date Time Frm Database - Development process
Retrieve Date Time Frm Database  Hi Friend, Ow to retrieve Date and Time at a time from ms Access database. For Storing data time...(); For Retrieving date -------------- need code to retrieve date and time

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.