473,566 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JSP code to insert date in oracle

1 New Member
I have written jsp code to insert date in oracle
but its giving error null.my code is:


Expand|Select|Wrap|Line Numbers
  1. String query="insert into test_KMS_DATA_ROW values('"+rocode+"','"+roname+"',"+activityId+",'"+activity+"',"+duration+",to_date("+startdate+",MM/DD/YYYY HH24:MI:SS),'"+starttime+"',to_date("+enddate+",MM/DD/YYYY HH24:MI:SS),'"+endtime+"','"+startby+"','"+endby+"','"+d+"','N')";
  2.  
  3. stmt1=con.createStatement();
  4. int n=stmt1.executeUpdate(query);
  5.  

please help me on this....
thanx in advance...
Mar 6 '11 #1
0 1950

Sign in to post your reply or Sign up for a free account.

Similar topics

18
10257
by: Robin Lawrie | last post by:
Hi again, another problem! I've moved from an Access database to SQL server and am now having trouble inserting dates and times into seperate fields. I'm using ASP and the code below to get the date and time, but my script is erroring. '-- Get login date and time cmdLoginDate = Date() cmdLoginTime = Time()
7
2436
by: Arek | last post by:
Hey, I am inserting values in the table: Dim sqlcomm1 As SqlCommand = New SqlCommand("INSERT INTO tblTasks (idTask, outdate) VALUES ('" & IDTask.text & "','" & txtOutdate.Text & "')", conn) sqlcomm1.ExecuteNonQuery() Query is working fine if there is value in the txtOutDate, but if user leaves the field txtOutdate empty, system insert...
1
10387
by: SSG | last post by:
How to insert date to the sql server database. I am getting input from the HTML form and store it to database using ASP. how to store date field, what datatype needed and what conversion needed. Thanx & Regards, SSG
3
9590
by: kiask2343 | last post by:
Ok I need a little help here. I need the code to insert todays date into a specific field. This is what I think I need but I don't know how to make it work. INSERT INTO target ])] VALUES (value1) This is how I wrote it. VBA:
1
8034
by: nihilks | last post by:
i use ADO in VB6 to connect to my Oracle database i made aconnection object 'con' and opened the database using it when i executed the statement con.Execute "insert into employee(no,,join_date) values(424,'12-SEP-2004')" i found that he new record was inserted into the database(i checked it using sql*plus) . But when retrieved through vb...
0
1618
by: sourabhmca | last post by:
hi friend, I am want to insert date with time into sql server2000 using JSP.I hv 3 combo box for dd mm yyyy and 2 text box for hh and min ? and my table field type is smalldatetime.after that i want compare 2 date and want time in hh and min and display diff time and both date on sql server ? plz help soon?
1
2133
by: yzlin04 | last post by:
Does anyone know how to insert date into vb.net datagrid by using INSERT INTO command? From the code below, the error message is in cmd.ExecuteNonQuery() line. Here is the error message: An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll Dim today As Date today = Date.Today
0
1407
by: raoofahmedkhan | last post by:
Hi All, I am trying to develop an application in vb.net in which i need to insert date in oracle database, my application is in vb.net. i am getting some problem while inserting date. Does anybody know how to get it done. Any help would be appreciated. Regards.
5
5106
by: zensunni | last post by:
I like to use this method when inserting into a database: Set Insert = Server.CreateObject("ADODB.Recordset") Insert.Open "test", objConn, 1, 3, 2 Insert.AddNew Insert("FIRSTNAME") = "Joe" Insert("LASTNAME") = "bob" Insert("DATE_BORN") = "10/10/80" Insert.Update Insert.Close
2
2024
by: ankitjain100 | last post by:
Hello Guys, This is my first question on this platform. I want to ask that How to insert Date in MY SQL in the MM-DD-YY format i am using JSP as my frontend. Please tell me , i will be very thankful you all. Ankit
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8109
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.