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



Home Answers Viewqa Date-Calendar storing date from html form to oracle 10g using servlet

Have Programming Question? Ask it here!
 
 
 


shivangi gupta
storing date from html form to oracle 10g using servlet
0 Answer(s)      2 years and 5 months ago
Posted in : Date-Calendar


i have following html form from where date,month and year is retrieved separately..

<Html>
<form action="./registration.java" method="post">
<select name="DOB_Month">
    <option> - Month - </option><option value="January">January</option>
    <option value="Febuary">Febuary</option><option value="March">March</option>
    <option value="April">April</option><option value="May">May</option>
    <option value="June">June</option><option value="July">July</option>
    <option value="August">August</option><option value="September">September</option>
    <option value="October">October</option><option value="November">November</option>
    <option value="December">December</option>
</select>
<select name="DOB_Day">
<option> - Day - </option><option value="1">1</option><option value="2">2</option>
<option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option>
<option value="9">9</option><option value="10">10</option><option value="11">11</option>
<option value="12">12</option><option value="13">13</option><option value="14">14</option>
<option value="15">15</option><option value="16">16</option><option value="17">17</option>
<option value="18">18</option><option value="19">19</option><option value="20">20</option>
<option value="21">21</option><option value="22">22</option><option value="23">23</option>
<option value="24">24</option><option value="25">25</option><option value="26">26</option>
<option value="27">27</option><option value="28">28</option><option value="29">29</option>
<option value="30">30</option><option value="31">31</option>
</select>
<select name="DOB_Year"><option> - Year - </option>
<option value="2004">2004</option><option value="2003">2003</option>
<option value="2002">2002</option><option value="2001">2001</option>
<option value="2000">2000</option><option value="1999">1999</option>
<option value="1998">1998</option><option value="1997">1997</option>
<option value="1996">1996</option><option value="1995">1995</option>
<option value="1994">1994</option><option value="1993">1993</option>
<option value="1992">1992</option><option value="1991">1991</option>
<option value="1990">1990</option><option value="1989">1989</option>
<option value="1988">1988</option><option value="1987">1987</option>
<option value="1986">1986</option><option value="1985">1985</option>
<option value="1984">1984</option><option value="1983">1983</option>
<option value="1982">1982</option><option value="1981">1981</option>
<option value="1980">1980</option><option value="1979">1979</option>
<input type="submit" name="sub" id="sub"/>
</select>
</form>
</Html>

i want to insert this date month year from html form into oracle 10g database where i have a table named "details" and column name "dob" of "date" type...for this i have created a "registration.java" servlet..coding is as follows:

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.*; 
public class registration extends HttpServlet {
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        Connection con=null;
        Statement st=null;
        ResultSet rs=null;
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","ORS","ors");

 // code for inserting date into oracle 10g in the format of oracle


        } catch(ClassNotFoundException c)
        {
            System.out.println(c);
        }
        catch(SQLException se)
        {
            System.out.println(se);
        }
        finally {
            try{
           rs.close();
            st.close();
           con.close();
            }catch(SQLException se)
            {
                System.out.println(se);
            }
            }
            }

Note: i have mentioned here only necessary coding..not mentioned here my full html form and servlet coding.... i don't know what should be the coding for inserting date in oracle's format..if der is ny1 to help me for the code of inserting date..i have tried a lot to find on google..but was not able to get the solution..so finally hv decided to post here...plz help me thnx in advance.....:):)


Advertisement
View Answers

Related Tutorials/Questions & Answers:
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
Advertisements
Insert or retrieve image into oracle 10g by using java
Insert or retrieve image into oracle 10g by using java   How can i insert or retrieve image into oracle10g using java plz i need it urgently,need guidance to do this plz
How to create a databas locally in our system using Oracle 10g????
How to create a databas locally in our system using Oracle 10g????  How to create a databas locally in our system using Oracle 10g
Uploading file in servlet from a html form
Uploading file in servlet from a html form  Sir, I want to upload a picture from my html file and save it to my database as BLOB,but what JAR should... this process without using a third party JAR, just using Java API. please help
calling java method from html form with out using javascript - JSP-Servlet
calling java method from html form with out using javascript  How can i call java method from a HTML form, java script should be disabled?  ...;script LANGUAGE="JavaScript">function testResults(form
fetch record from oracle database using jsp-servlet?
fetch record from oracle database using jsp-servlet?  how can i fetch data from oracle database by using jsp-servlet. i'm using eclipse, tomcat server and oracle database and creating jsp pages and also using servlet
error in uploading image from jsp to oracle 10g database
error in uploading image from jsp to oracle 10g database  ...;TITLE>Display file upload form to the user</TITLE></HEAD> <BODY> <FORM ENCTYPE="multipart/form-data" ACTION="upload.jsp" METHOD=POST>
tables in oracle 10g
tables in oracle 10g  sir i have created a table in oracle 10g,i want to know where this table is stored and how can i move this table to another pc and insert values
instruction to install oracle 10g in linux....
instruction to install oracle 10g in linux....  how to install oracle 10g in linux
i need a school appication using struts frame work with oracle 10g using myeclipse6.0
i need a school appication using struts frame work with oracle 10g using myeclipse6.0   hi i need a school apllication using struts frame work backend 10g xe using myeclipse 6.0
data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp
data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp   data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp with script of data base plz help me
i am getting the problem when i am downloading the pdf file from oracle 10g database - Struts
i am getting the problem when i am downloading the pdf file from oracle 10g database  if i created the pdf file from pdf machine,it is storing into datbase and download the pdf file from database. but when i created the pdf file
how to load values of html form into an excel table using java servlet?
how to load values of html form into an excel table using java servlet?   i have written a java servlet program, which has a html form to be filled. after filling the form the servlet generates a receipt and the values should
android connection to database oracle 10g
android connection to database oracle 10g  Hello, How i can connect my android application to my oracle 10g database
storing csv into oracle database
storing csv into oracle database  i want jsp code for storing csv file into oracle database
Tomcat not supporting Oracle 10g - WebSevices
Tomcat not supporting Oracle 10g  While Starting my Tomcat Server am... of Oracle version(Oracle 8i to Oracle10g). SEVERE: End event threw exception... time=16/47 config=C:\Tomcat 4.1\bin\..\conf\jk2.properties
html form - JSP-Servlet
html form  how to retrieve database value in dropdown list box placed in html form  Hi friend, Visit for more information. http://www.roseindia.net/jsp/ Thanks
Oracle 10g Express Edition - IDE Questions
Oracle 10g Express Edition  Do we need internet connection to work with oracle10g Express Edition
Html form validation using jquery
Html form validation using jquery  Hi i am using form with html. Form elements like textbox, radio,checkbox,listbox i was used now how to validate the elements using submit jquery option
HTML form validation using jquery
HTML form validation using jquery  Is there any way for validating html elements common under a class by giving its class name in jquery validation code..that means validating all elements by using its class name if those
Sending form data from HTML page to SQLserver 2005 database by calling servlet code
Sending form data from HTML page to SQLserver 2005 database by calling servlet code  Hi sir, I would like to know how to send the form data from html page to database by calling servlet code from html page .   
How to get the data from the database (Oracle) in console or in ie using servlet or jsp as Front end
How to get the data from the database (Oracle) in console or in ie using servlet or jsp as Front end  hello i have a simple problem in jsp in the sense to get data from the database like oracle . I have created one jsp
JSP:HTML Form in-place Editing - JSP-Servlet
JSP:HTML Form in-place Editing  I have an HTML form (form #1) which... of a customer search in a small table on the same page using another servlet(also working... from a stringquery into another page and having the same form, for some reason
what is difference b/w oracle 8i, 9i and 10g
what is difference b/w oracle 8i, 9i and 10g  what are the difference between oracle 8i,9i and 10g? I am not considering the versions and their supported os, in the interview point of view
Html form using JavaScript to display the table content
Html form using JavaScript to display the table content  HI There, Greetings, I am new to this java and I need your assistance. I have created... want to write a Html JavaScript coding to display the content from database
example of 1700 bir form using html
example of 1700 bir form using html   example of 1700 bir form using html i don't know how to start it... i'm confused on what would i do first and what would i use... :( please help me on this.... thank you in advance
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
Upload csv or .xlsx file from JSP form to Database Table using servlet
Upload csv or .xlsx file from JSP form to Database Table using servlet  dear sir, i need the Servlet code that reads the .xlsx or CSV excel file and stores it into the oracle database table. Sir Its very Urgent I have
JSP:HTML Form in-place Editing - JSP-Servlet
JSP:HTML Form in-place Editing  Hi, I want to thank the people... developer's needs. This is a follow up to the HTML Form in-place editing. The code... an excellent way of editing a form. I just have a few adjustments if any of you could
JSP to add details to a database from a HTML form.
JSP to add details to a database from a HTML form.  Hi I'm a second year CS student who has to use JSP to validate a HTML form and add the details... from form and stores it in User--%> String Pword = request.getParameter
how to write a jsp form using html
how to write a jsp form using html  hi, i have written the code as below... but it is showing error. please help me how to resolve it. .html file...; <body> <form method="POST" action="Form1.jsp"> EmployeeNo: <
Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data..
Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data... from oracle sql*plus as rajalakshmi and password by granting privilege from scott... max("+pkid+") from "+tableName); if(rs.next
how to update values of a html form into an excel table using java servlets?
how to update values of a html form into an excel table using java servlets?  i have written a java servlet program, which has a html form to be filled. after filling the form the servlet generates a receipt and the values should
how to store image in oracle express edition using servlet
how to store image in oracle express edition using servlet  strong text how to store image in oracle express edition using servlet?   Please visit the following link: Servlet Insert image into MySQL database
jsp or sevlet and html form to send picture to database - JSP-Servlet
that contains his picture to database. What I need are html page for the form that will browse for the picture, jsp or servlet that the info from html will go...jsp or sevlet and html form to send picture to database  Hello guys
Using a image for Browse button instead of normal html Browse button for Uploading files from a JSP - JSP-Servlet
Using a image for Browse button instead of normal html Browse button for Uploading files from a JSP  I am using the following code snippet.... Is it not possible to use a image instead of normal html Browse button for uploading files
how to read data from excel file through browse and insert into oracle database using jsp or oracle???
how to read data from excel file through browse and insert into oracle database using jsp or oracle???  sir.. i have number of excel sheets which... be inserted into oracle database.. please help me sir...   hi friend
how to load a table of data from oracle, to a jsp page using hashmap.
how to load a table of data from oracle, to a jsp page using hashmap.  I have a jsp page which ask for project ID,team name,member name according to this data i have to retrieve their details from the database(oracle). I have
how to generate reports from oracle database using jsp and ajax code
how to generate reports from oracle database using jsp and ajax code  Hai masters i am new to this Java world. my team leader ask me to generate sales report data from oracle database to jsp page please any one know how to do
How to retrieve array values from html form to jsp?
How to retrieve array values from html form to jsp?  Hi! I am... it into jsp. Means i just want to retrieve values from html form containing array..., To get an array values from the html form you can use the getParameterValues
How to get data from Oracle database using JSP
How to get data from Oracle database using JSP  hello i have a simple problem in jsp in the sense to get data from the database like oracle . I have... the answer to retrieve data from the database by using servlet or jsp program
call json object using url and represent in html tabular form
call json object using url and represent in html tabular form  how to call json object using url from html and represent in proper format it gives Json object after that i want to arrange the keys-values in table
call json object using url and represent in html tabular form
call json object using url and represent in html tabular form  how to call json object using url from html and represent in proper format it gives Json object after that i want to arrange the keys-values in table
how to save html form data into .csv file using only jsp.
how to save html form data into .csv file using only jsp.  Dear all, I am developing a website only using jsp and html. i need to save the form data into a .csv file using jsp. can anyone give me any sample solution or tutorial
Calling In JavaScript Functions from HTML Form To Validate User Entered Data
Calling In JavaScript Functions from HTML Form To Validate User Entered Data  Hello, I have been working for days on my web Form assignment and editing my html to call my functions to validate the user entered data
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... Database, but we cant free that from our data base if the given Out-date
how to pass form values from javascript of html page to jsp page
how to pass form values from javascript of html page to jsp page   This is my sample html page which contains inline javascript which calculates... to submit all the form values with lattitude and longitude returned from
HTML code to servlet to database using jdbc
HTML code to servlet to database using jdbc  pls send me the code...: <html> <form method="post" action="http://localhost:8080/examples/Data...=req.getParameter("msg"); res.setContentType("text/html"); PrintWriter
Error in jdeveloper 10G
[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0...Error in jdeveloper 10G   500 Internal Server Error...._jspService(Address.jsp:16) [SRC:/Address.jsp] at com.orionserver[Oracle
Advertisements
 

 

 

DMCA.com