Professional Documents
Culture Documents
IP-IA 2 Answer Key
IP-IA 2 Answer Key
IP-IA 2 Answer Key
Doc. Ref.
COIMBATORE -35, TN, INDIA
EXAMINATIONS - FORMS
Issue No / Date
ANSWER KEY
ACADEMIC YEAR: 2022 - 2023 Department CSE
6(a).Demonstrate Servlet Architecture & Life Cycle of Servlet with a neat diagram.
(or)
KGISL INSTITUTE OF TECHNOLOGY,
Doc. Ref.
COIMBATORE -35, TN, INDIA
EXAMINATIONS - FORMS
Issue No / Date
ANSWER KEY
ACADEMIC YEAR: 2022 - 2023 Department CSE
6(b).Demonstrate the steps involved in Database connectivity with different types of JDBC drivers.
Steps For Connectivity Between Java Program and Database
Import the Packages
Load the drivers using the forName() method
Register the drivers using DriverManager
Establish a connection using the Connection class object
Create a statement
Execute the query
Close the connections
steps in brief before implementing by writing suitable code to illustrate connectivity steps for JDBC
Step 1: Import the Packages
Step 2: Loading the drivers
2-A Class.forName()
2-B DriverManager.registerDriver()
Step 3: Establish a connection using the Connection class object
Step 4: Create a statement
Step 5: Execute the query
7(a). Use regular expression for string comparison capability in PHP with an example.
preg_match() tester function for the above example.
<?php
$my_url = "www.guru99.com";
if (preg_match("/guru/", $my_url))
{
echo "the url $my_url contains guru";
}
else
{
echo "the url $my_url does not contain guru";
}
?>
PHP Preg_split()
<?php
$my_text="I Love Regular Expressions";
$my_array = preg_split("/ /", $my_text);
print_r($my_array );
?>
PHP Preg_replace()
<?php
$text = "We at Guru99 strive to make quality education affordable to the masses. Guru99.com";
$text = preg_replace("/Guru/", '<span style="background:yellow">Guru</span>', $text);
echo $text;
?>
(Or)
KGISL INSTITUTE OF TECHNOLOGY,
Doc. Ref.
COIMBATORE -35, TN, INDIA
EXAMINATIONS - FORMS
Issue No / Date
ANSWER KEY
ACADEMIC YEAR: 2022 - 2023 Department CSE
(or)
8(b).Determine the uses of Java Server Pages Standard Tags Library.
1<fmt:formatNumber> To render numerical value with specific precision or format.
2<fmt:parseNumber>Parses the string representation of a number, currency, or percentage.
3<fmt:formatDate>Formats a date and/or time using the supplied styles and pattern
4<fmt:parseDate> Parses the string representation of a date and/or time
5<fmt:bundle>Loads a resource bundle to be used by its tag body
6<fmt:setLocale>Stores the given locale in the locale configuration variable.
7<fmt:setBundle>Loads a resource bundle and stores it in the named scoped variable or the bundle
configuration variable.
8<fmt:timeZone>Specifies the time zone for any time formatting or parsing actions nested in its body.
9<fmt:setTimeZone>Stores the given time zone in the time zone configuration variable
10<fmt:message>Displays an internationalized message.
11<fmt:requestEncoding>Sets the request character encoding
Prepared By Approved by
Faculty HOD