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



Home Answers Viewqa Development-process Insert Date using Statement
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Rajendra
Insert Date using Statement
1 Answer(s)      5 years and 7 months ago
Posted in : Development process



Advertisement
View Answers

June 1, 2009 at 2:39 PM


Hi Friend,

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:
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
insert date into database using jsf
insert date into database using jsf  Hello I need a simple example of source code to insert a date into a database using jsf what do I have to put in backing bean and page jsf ( i need juste a date ) thanks
Advertisements
to write an SQL query using insert statement
to write an SQL query using insert statement  I need to write an sql query for the below using InSERT command.pls help. Insert 5-star ratings by James Cameron for all movies in the database. Leave the review date as NULL
The INSERT INTO Statement, SQL Tutorial
The INSERT INTO Statement       The INSERT INTO statement is used to insert or add a record of data into the table. To insert records into a table, just write the key word
Insert data in mysql database through jsp using prepared statement
Insert data in mysql database through jsp using prepared statement...; This is detailed jsp code that how to insert data into database by using prepared statement...; <HEAD> <TITLE>insert data using prepared statement </TITLE>
The INSERT INTO Statement
The INSERT INTO Statement       The INSERT INTO statement is used to insert or add a record... statement: INSERT INTO employee (emp_name
Set Date by using the Prepared Statement
Set Date by using the Prepared Statement  ... for setting date in the database table by using the PreparedStatement interface... to insert the date in database table (Records) with the help
callable statement,stored procedure for insert data and also for update data into oracle database using jsp
callable statement,stored procedure for insert data and also for update data into oracle database using jsp  iam a fresher newbie to softparsing i have one task to do soft parsing tl asked to do callable statement,stored
How to insert multiple checkboxes into Msaccess database J2EE using prepared statement - Java Beginners
How to insert multiple checkboxes into Msaccess database J2EE using prepared... statement to do the checked boxes part, I'm not sure how to go about doing..."); int subjects = strSubjects.length; strCreateRecordSQL = "INSERT INTO Parents
oracle insert statement error - JDBC
oracle insert statement error  hi.. please help me to insert a image into oracle 11g database and please say me how can i insert image from directory like G:\imagefolder\ultrasoundimage\02us02.jpeg please help me
Insert data in mysql database through jsp using Prepared Statement ---- Please Resolve it
Insert data in mysql database through jsp using Prepared Statement ---- Please...,"root","root"); String queryString = "INSERT INTO stu_info(Name,City,Phone...;Please visit the following link: http://www.roseindia.net/jsp/prepared-statement
Insert data in mysql database through jsp using Prepared Statement ---- Please Resolve it
Insert data in mysql database through jsp using Prepared Statement ---- Please...(connectionURL,"root","root"); String queryString = "INSERT INTO stu_info(Name,City... link: http://www.roseindia.net/jsp/prepared-statement-query.shtml   
Jdbc Insert Statement
JDBC Insert Statement       Add a row to a existing table using insert statement in JDBC... the INSERT statement using execute Update ( ).The executeQuery ( ) return
JDBC Prepared Statement Insert
JDBC Prepared Statement Insert   ... Statement Insert. In this Tutorial  the code describe the include a class... the given below code, we declare String variable sql,that is used to hold the insert
insert into statement in sql using servlets
insert into statement in sql using servlets   ... insert a value from a html form in the table stored in the database. ... we are going to insert the values. Now make one jsp page or  html page
syntax error in SQL Insert Statement - Java Beginners
: PreparedStatement stm1=con.prepareStatement("insert into newfresher(prn,date... Access Driver] Syntax error in INSERT INTO statement. plz Help Me  Hi...syntax error in SQL Insert Statement  Dear Sir ,I have write
syntax error in SQL Insert Statement - Java Beginners
=stmt.executeUpdate("insert into newfresher(prn,date,lname,mname,dob,address,city...+"' /*PreparedStatement stm=con1.prepareStatement("Insert into newfresher(prn,date,lname,fname,mname...syntax error in SQL Insert Statement   private class ButtonListener
help with JDateChooser to insert date into sql
help with JDateChooser to insert date into sql  TextField3 = new com.toedter.calendar.JDateChooser(); TextField3.setDateFormatString("MM-d-y...? Statement stmt=con.createStatement(); stmt.executeUpdate("insert into special
Insert current date into MYSQL database
statement to the database. Here, we are going to insert the id and date to a database...Insert current date into MYSQL database In this tutorial, you will learn how to insert current date into database. In most of the applications
JDBC Insert Statement Example
.style1 { text-align: center; } JDBC Insert Statement Example JDBC Insert statement allow you to insert record into the table of the database... the database and insert record to the database. At first create table named student
PHP SQL Insert Statement
PHP SQL Insert Statement       PHP SQL Insert Statement show you the message when the records... The Tutorial illustrate an example from 'PHP SQL Insert Statement'. To understand
insert image using hibernate
insert image using hibernate  Sir, Today I hadposted question regarding upload image, th answer you had given is using SQL, but I am using Hibernate to insert data in the same table where I want to insert image. Plz hlp me
JDBC Batch Example With SQL Insert Statement
JDBC Batch Example With SQL Insert Statement: In this tutorial, we are discuss about insert SQL statement with the jdbc batch. First of all, we... for data insertion in the database table. 1. Create Statement object using
JDBC Insert Prepared Statement
; } JDBC Insert PreparedStatement PreparedStatement represents a precompiled SQL statement. It is alternative to Statement At first Create named... Insert PreparedStatement Example."); Connection conn = null; PreparedStatement
using case in update statement
using case in update statement  i want to use case in update clause. i have used case in select stmt referring answer in this site. but the same syntax is not working for update stmt.my problem is update emp set case deptno
Date object using JavaScript
Date object using JavaScript  What's the Date object using JavaScript
Code to insert date in to database - Development process
Code to insert date in to database  Hi , in my following code i want to store date in to msaccess database. i have tried many queries, but am getting error . plz send me code Error 500--Internal Server Error
Writing a loop statement using Netbean
Writing a loop statement using Netbean  Write a loop program using NetBeans.   Java Loops class Loops{ public static void main(String[] args){ int sum=0; for(int i=1;i<=10;i
insert code using spring - Spring
insert code using spring  Hi, Can any one send code for inserting the data in database using spring and hibernate .. Many thanks, Raghavendra  Hi Friend, Please visit the following link: http
insert data in the database using checkbox
insert data in the database using checkbox  i am fetching data from the database using servlet on the jsp page and there is checkbox corresponding... should i insert only checked data into database on submission.   We
php code: how to insert manual date and also retrieve records by selecting date field. - Date Calendar
php code: how to insert manual date and also retrieve records by selecting date field.  In PHP, how to insert user input date on mysql db. and also how to retrieve records by selecting user input date manually. For example, User
Advertisements
 

 

 

DMCA.com