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



Home Answers Viewqa Servlet-Interview-Questions Servlet stored procedure
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


jeevani
Servlet stored procedure
1 Answer(s)      6 years and 10 months ago
Posted in : Servlet Interview Questions


An example of Servlet stored procedure


Advertisement
View Answers

March 17, 2008 at 9:18 PM



Example
- - - -
web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
version="2.4">


<servlet>
<init-param>
<param-name>name</param-name>
<param-value>amardeep</param-value>
</init-param>
<init-param>
<param-name>lastname</param-name>
<param-value>Patel</param-value>
</init-param>
<init-param>
<param-name>position</param-name>
<param-value>Programer</param-value>
</init-param>

<init-param>
<param-name>email</param-name>
<param-value>amar_mca@rediffmail.com</param-value>
</init-param>

<context-param>
<Parameter name="companyName" value="My Company, Roseindia plt." override="false"/>
<param-name>companyName</param-name>
<param-value>My Company, Roseindia plt.</param-value>
</context-param>

<servlet-name>employee</servlet-name>
<servlet-class>EmployeeDetail</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>employee</servlet-name>
<url-pattern>/EmployeeDetail</url-pattern>
</servlet-mapping>

</web-app>


EmployeeDetail.java

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class EmployeeDetail extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("\n First Name:" + getServletConfig().getInitParameter("name"));
out.println("Last Name:" + getServletConfig().getInitParameter("lastname"));
out.println("Position:" + getServletConfig().getInitParameter("position"));
out.println("E-mail:" + getServletConfig().getInitParameter("email"));
out.println("Company-Name:" + getServletConfig().getInitParameter("companyName"));

}
}
------------
Amar.........


Related Tutorials/Questions & Answers:
stored procedure
stored procedure  what is stored procedure
stored procedure
stored procedure  on storing values to database using stored procedure it throws an error lyk ADODB.Command error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another
Advertisements
Stored Procedure and Trigger
Stored Procedure and Trigger  hello, What is the difference between Stored Procedure and Trigger ?   hii, Triggers once defined are called automatically, there can be no explicit invocation Stored procedure has
What is Stored Procedure?
What is Stored Procedure?  What is Stored Procedure?   Hi, Here is the answer, A stored procedure is a named group of SQL statements that have been previously created and stored in the server database. Stored
receive a ResultSet from a stored procedure
receive a ResultSet from a stored procedure  How do I receive a ResultSet from a stored procedure
update date from stored procedure
update date from stored procedure  how to works on insert,update data from stored procedure.   Insert data using stored procedure
Processing stored procedure in MySQL - SQL
Processing stored procedure in MySQL  Dear All java with mysql developer..... i need to convert my SQL procedure to MySQL database... here is my Stored procedure in SQL.... create or replace procedure INVNAMES (bno
JPA 2.1 Stored Procedure Example
JPA 2.1 Stored Procedure Example - Lear how to call stored procedures from JPA program In this tutorial you will learn how to create Stored Procedure in MySQL database and then call the stored procedure in your JPA 2.1 based
creating and executing stored procedure using hibernate
creating and executing stored procedure using hibernate  I have to execute following query using hibernate DECLARE @i_STARTDATETIME DATETIME DECLARE @i_ENDDATETIME DATETIME DECLARE @o_ERRORCODE INT DECLARE @o_ERRORDESCRIPTION
Insert Data in Table Using Stored Procedure
into a table using stored procedure. Steps: 1.Create database: To create...;); 7.Step to call procedure: We are using CallableStatement to execute a stored...;} } The code of the stored procedure is given below
Write a C/C++ program to show the result of a stored procedure
Write a C/C++ program to show the result of a stored procedure   how to write this?? Write a C/C++ program to show the result of a stored procedure "PROCRESETMAIL" on database "USER_NOTIFY
supplying values to in parameters of stored procedure in ms sql and displaying out parameters
supplying values to in parameters of stored procedure in ms sql and displaying out parameters  I have to execute following procedure ALTER PROCEDURE [dbo].[get_date] @codeId int, @vardate as datetime OUTPUT AS SELECT
procedure
procedure   step by step procedure to build servlet or jsp in eclipse
Records are not inserting in to main table while running the mysql stored procedure.
Records are not inserting in to main table while running the mysql stored procedure.  Hi, Im migrating procedures from oracle to MySql.In that procedure records are not inserted into main table from temp table.But im getting msg
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... have one task to do soft parsing tl asked to do callable statement,stored procedure for inserting data into oracle database as bind variable and same
Fastest way to upload huge raw data in database - c#, Java or stored procedure
Fastest way to upload huge raw data in database - c#, Java or stored.... This procedure repeats every 15days. I need to know which method would be fastest to upload this data - Stored procedures, Java or c#. Why? What are the advantages
procedure
procedure  write a procedure to update salary to 20% based on employee number
passing xml created using DocumentBuilderFactory as input to oracle stored procedure using java JDBC
and it is to be send using JDBC. Stored procedure in oracle database will contains two... passing xml created using DocumentBuilderFactory as input to oracle stored procedure using java JDBC  I want to send the xml as input parameter
application of remote procedure call - JSP-Servlet
application of remote procedure call  give the small application for the remote procedure call and its related program code in java
remote procedure call using java - JSP-Servlet
remote procedure call using java  what is the romote procedure call and related coding in java?  Hi Friend, The RPC (Remote Procedure Call) is a mechanism that enables a remote procedure call from a client
image upload and stored in database - JSP-Servlet
image upload and stored in database  How can i upload a image and store that image in a database
image upload and stored in database - JSP-Servlet
image upload and stored in database  How can i upload a image and store that image in a database
How to browse excel file and stored the contents into the database using jsp/servlet?
How to browse excel file and stored the contents into the database using jsp/servlet?  Hi.. I want to browse excel file and stored the file data into the My-sql database using jsp/servlet
image upload and stored in database - JSP-Servlet
image upload and stored in database  How can i upload a image and store that image in a database  Hi Friend, Try the following code: 1)page.jsp: Display file upload form to the user UPLOAD
values of Combo boxes are not stored in database - JSP-Servlet
values of Combo boxes are not stored in database   i have some combo box values. when i click the submit button after select combo box values, the values are not going in database. please review the code: function
Stored Procedures and Functions
in version MySQL 5.0. Stored Procedure is a set of statements, which allow ease and flexibility for a programmer because stored procedure is easy to execute than reissuing the number of individual SQL statements. Stored procedure can call another
Stored procedures
;hello, A stored procedure is a set of statements or commands which reside in the database. The stored procedure is precompiled. Each Database has it's own stored procedure language,   Hi, Learn how to create Stored Procedure
Stored Data in XML File using Servlet
Stored Data in XML File using Servlet  ... to stored data in xml file using Servlet  We have created  file login.jsp,XmlServlet.java. User details in the "login.jsp" are to be stored
iBatis Stored Procedure Example
iBatis Stored Procedure Example   ... have created a stored procedure in "vin" database named as showData... stored procedure. <procedure id="storedInfo" resultClass="Contact">
What is procedure
What is procedure  What is procedure in computers? What are the primary categories of procedures
stored procedures
stored procedures  What are stored procedures
 

 

 

DMCA.com