JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III WEB TECHNOLOGIES Previous Question Paper (August - 2022 - R18)
Answer any five questions. All questions carry equal marks.
Main
List and explain the advantages and disadvantages of MySQL and PHP.
Answer
MySQL is an open-source relational database management system. Its advantages include high performance, ease of use, strong data security, and wide support for various storage engines. Its disadvantages involve limitations in handling extremely large datasets compared to enterprise-grade databases like Oracle, and potential performance issues with complex nested queries.
PHP is a server-side scripting language designed for web development. Its advantages include ease of integration with databases, a vast ecosystem of frameworks and libraries, and broad hosting support. Its disadvantages include inconsistent language design, potential security vulnerabilities if not coded carefully, and lower performance for CPU-intensive tasks compared to compiled languages.
Explain the steps involved in connecting the MYSQL database from PHP. Write an example PHP script illustrating how to retrieve and display records from the database.
Answer
To connect to MySQL from PHP, the following steps are required: 1) Define database credentials (host, username, password, database name). 2) Initialize a connection using the mysqli_connect() function or the PDO class. 3) Verify the connection status. 4) Execute a SQL query using mysqli_query(). 5) Fetch results using functions like mysqli_fetch_assoc(). 6) Close the connection using mysqli_close().
Example script:
<?php
$conn = mysqli_connect('localhost', 'root', '', 'test_db');
if (!$conn) { die('Connection failed: ' . mysqli_connect_error()); }
$sql = 'SELECT id, name FROM users';
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
echo 'ID: ' . $row['id'] . ' - Name: ' . $row['name'] . '<br>';
}
} else { echo '0 results'; }
mysqli_close($conn);
?>Explain the file handling in PHP.
Answer
Sign in to view the complete answer paper.
Differentiate between DTD and XML scheme with suitable example.
Answer
Sign in to view the complete answer paper.
Define XML. List and explain the advantages of XML.
Answer
Sign in to view the complete answer paper.
Explain the DOM and SAX Parsers in java.
Answer
Sign in to view the complete answer paper.
Explain the Common Gateway Interface.
Answer
Sign in to view the complete answer paper.
Explain the Life cycle of a Servlet.
Answer
Sign in to view the complete answer paper.
Describe the Handling HTTP Request and Responses.
Answer
Sign in to view the complete answer paper.
How can you invoke other web resources such as servlets /JSPs?
Answer
Sign in to view the complete answer paper.
Write a JSP to demonstrate the usage of the page and include directives.
Answer
Sign in to view the complete answer paper.
Explain the JSP Processing.
Answer
Sign in to view the complete answer paper.
How to insert JavaScript Code while developing a web application? Explain.
Answer
Sign in to view the complete answer paper.
Explain this keyword in JavaScript.
Answer
Sign in to view the complete answer paper.