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

 
 


shivangi gupta
storing date from html form to oracle 10g using servlet
0 Answer(s)      a year and 3 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.....:):)

View Answers









Related Pages:
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
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
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
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>
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
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
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
Oracle Books
Edge: "I enjoyed this book from the beginning 'til the end. The Oracle Edge... Oracle Application Server 10g Administrator Exam Guide A powerful... and CD-ROM package, exclusively from Oracle Press, covers all the material
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
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
HTML form example
HTML form example In this section we will develop HTML form example and show you how to performance form validation using JavaScript. The HTML <form>...; HTML Form Example </title> <script type="text/javascript">
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
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
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
storing csv into oracle database
storing csv into oracle database  i want jsp code for storing csv file into oracle database
Problem with url in oracle
code. when i run it i get the error as invalid oracle url specified. i am using tomcat 6 and oracle 10g release2 10.2.0.3. heres the code <html> <... language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding
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
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
oracle - JDBC
oracle  HI i am using ORACLE 10g. How to i find "TNSNAMES.ORA" file in my system after installation of ORACLE 10g succussfully. please send... in the tnsnames.ora file The session data unit (SDU) and transport date unit (TDU
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
Passing Parameter Using Html Form
Passing Parameter Using Html Form   ... which will work as a controller here picks the value from the html page by using... to display the name on the browser which we have entered from the Html page
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
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
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
retrive data from oracle to jsp
retrive data from oracle to jsp  i am a beginer in jsp so please help... cost and manager name and storing it in the data base. in search proj fiel...(); psmt= conn.prepareStatement("select * from CR_EMPLOYEE_DETAILS
HTML Post Form
an example from HTML Post Form. In this Tutorial, the code explain you a post... HTML Post Form       The HTML process the submission of form in two different ways. In HTML
Html
Html  can we send data from one html page to another html page? if yes how?   Yes, using javascript. 1)page1.html: <html> <form type=get action="page2.html"> <table> <tr> <td>First Name
Copy text file in a HTML form.
Copy Text File in a HTML form For copying a text file from one source to other destination in HTML form, you will have to create a HTML form and call the form...;  Draw the HTML form <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
storing details in database on clicking submit button - JSP-Servlet
storing details in database on clicking submit button  I am using JSP in NetBeans and have developed an application form which has fileds naming 'Name' and 'ID'.I want to store the details of these two fields in the MYSQL
Oracle 10g Express Edition - IDE Questions
Oracle 10g Express Edition  Do we need internet connection to work with oracle10g Express Edition
Oracle Tutorial
Oracle is taken from the Latin verb "orare" which means "to speak". In Oracle RDBMS... as the data files form. To track the computer data storage Oracle database takes.... These are as follows : Oracle 10g, Oracle 9i, Oracle 8i, Oracle 7, Oracle v6, Oracle V5
Programming using applets and oracle - Applet
Programming using applets and oracle  Develop an Online Examination software in java using applets as front end and oracle as back end. Software... and True/False questions in the test. Questions will be randomly selected from
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
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
how to insert data in database using html+jsp
how to insert data in database using html+jsp  anyone know what... is student. */ String URL = "jdbc:oracle:thin:@10.2.160.244:1521:prodasdb"; // declare a connection by using Connection interface
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
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
How to delete the row from the Database by using servlet
: Delete row from database using servlet   In that link solution...How to delete the row from the Database by using servlet  Dear Sir... by using servlet program (Tomcat server). The given data is true
How to delete the row from the Database by using while loop in servlet
How to delete the row from the Database by using while loop in servlet ... server database by using Servlet program (Tomcat server). In Database table.... It is Urgent...  When you retrieve the data from the Database by using
Storing content from file path to an array
Storing content from file path to an array  Hi, I have a path... would like to access the "Animation.txt" file from this path and store the contents in this text file to an array. I am using jsp. I can access my path but how
disable the form - JSP-Servlet
are different.when I click the form button,one function is calling and the input values(only one input value is going to servlet) are going to servlet class using... Multiple form are created in Jsp. Servlet is used to insert the data. Ajax is used
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
HTML Form data into .CSV?
HTML Form data into .CSV?  how to store data from html form to csvfile in java