JSTL SQL <sql:param> TagThe <sql:param> tag sets the parameter value in SQL statement. It is used as nested tag for <sql:update> and <sql:query> to provide the value in SQL query parameter. If null value is provided, the value is set at SQL NULL for value attribute. Example: JSTL SQL <sql:param> Complete ExampleConsider the below information about your MySQL database setup:
To understand the basic concept, let us create a simple table Students in the test database and creates the few records in that table using command prompts as follows: Step-1: Open the command prompt and change to the installation directory as follows: It will look like this: Step-2: Login to the database using command prompt as shown below: It will look like this: Step-3: Create the table Students in test database as shown below: It will look like this: Step 4: In final step you need to create few data records in Students table as shown below: It will look like this: Let's see the simple JSP example to understand the use of < sql:param > tag is: This will produce the following result: Next TopicJSTL SQL <sql:dateParam> Tag |