- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 4336 Articles for Java 8
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
258 Views
Stored procedures are sub routines, segment of SQL statements which are stored in SQL catalog. All the applications that can access Relational databases (Java, Python, PHP etc.), can access stored procedures.Stored procedures contain IN and OUT parameters or both. They may return result sets in case you use SELECT statements. Stored procedures can return multiple result sets.Creating a Stored procedureSuppose, we have created a table named Employee in MySQL database as shown below:String createTable = "CREATE TABLE Employee(" + "Name VARCHAR(255), " + "Salary INT NOT NULL, " + "Location VARCHAR(255))";Following is an example of a MySQL ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
6K+ Views
The CallableStatement interface provides methods to execute the stored procedures. Since the JDBC API provides a stored procedure SQL escape syntax, you can call stored procedures of all RDBMS in single standard way.Creating a CallableStatementYou can create an object of the CallableStatement (interface) using the prepareCall() method of the Connection interface. This method accepts a string variable representing a query to call the stored procedure and returns a CallableStatement object.A Callable statement can have input parameters, output parameters or both. To pass input parameters to the procedure call you can use place holder and set values to these using the ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
10K+ Views
The PreparedStatement interface extends the Statement interface it represents a precompiled SQL statement which can be executed multiple times. This accepts parameterized SQL quires and you can pass 0 or more parameters to this query.Initially this statement uses place holders “?” instead of parameters, later on you can pass arguments to these dynamically using the setXXX() methods of the PreparedStatement interface.Creating a PreparedStatementYou can create an object of the PreparedStatement (interface) using the prepareStatement() method of the Connection interface. This method accepts a query (parameterized) and returns a PreparedStatement object.When you invoke this method the Connection object sends the given ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
633 Views
The Statement interface represents the static SQL statement, it is used to create and execute general purpose SQL statements using Java programs.Creating a statementYou can create an object of this interface using the createStatement() method of the connection interface. Create a statement by invoking this method as shown below.Statement stmt = null; try { stmt = conn.createStatement( ); . . . } catch (SQLException e) { . . . } finally { . . . }Executing the Statement objectOnce you have created the statement object you can execute it using one of the execute methods namely, ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
653 Views
Your web application may define several different filters with a specific purpose. Consider, you define two filters AuthenFilter and LogFilter. Rest of the process will remain as explained above except you need to create a different mapping as mentioned below − LogFilter LogFilter test-param Initialization Paramter AuthenFilter AuthenFilter test-param Initialization Paramter LogFilter /* AuthenFilter /* Filters Application OrderThe order of filter-mapping elements ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
500 Views
Following example shows how to print the client's IP address and the current date time, each time it would access any JSP file. This example will give you a basic understanding of the JSP Filter, but you can write more sophisticated filter applications using the same concept −// Import required java libraries import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; // Implements Filter class public class LogFilter implements Filter { public void init(FilterConfig config) throws ServletException { // Get init parameter String testParam = config.getInitParameter("test-param"); //Print the init parameter ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
149 Views
Servlet and JSP Filters are Java classes that can be used in Servlet and JSP Programming for the following purposes To intercept requests from a client before they access a resource at the back end.To manipulate responses from the server before they are sent back to the client.There are various types of filters suggested by the specifications −Authentication FiltersData compression FiltersEncryption FiltersFilters that trigger resource access eventsImage Conversion FiltersLogging and Auditing FiltersMIME-TYPE Chain FiltersTokenizing FiltersXSL/T Filters That Transform XML ContentFilters are deployed in the deployment descriptor file web.xml and then map to either servlet or JSP names or URL patterns in ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
1K+ Views
Following is a generic example which uses getParameterNames() method of HttpServletRequest to read all the available form parameters. This method returns an Enumeration that contains the parameter names in an unspecified order.Once we have an Enumeration, we can loop down the Enumeration in the standard manner, using the hasMoreElements() method to determine when to stop and using the nextElement() method to get each parameter name. HTTP Header Request Example HTTP Header Request Example ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
3K+ Views
Checkboxes are used when more than one option is required to be selected.Following is an example HTML code, CheckBox.htm, for a form with two checkboxes. Maths Physics Chemistry The above code will generate the following result − Maths Physics Chemistry Following is main.jsp JSP program to handle the input given by the web browser for the checkbox button. Reading Checkbox Data Reading Checkbox Data Maths Flag: Physics Flag: Chemistry Flag: The above program will generate the following result −Reading Checkbox DataMaths Flag :: onPhysics Flag:: nullChemistry Flag:: on
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
3K+ Views
Below is the main.jsp JSP program to handle the input given by web browser using the GET or the POST methods.Infact there is no change in the above JSP because the only way of passing parameters is changed and no binary data is being passed to the JSP program. File handling related concepts will be explained in a separate chapter where we need to read the binary data stream. Using GET and POST Method to Read Form Data Using POST Method to Read ... Read More