Which type of driver provides JDBC access via one or more ODBC drivers? - Answers Type 1 driver
Which of the following provides the application-to-JDBC Manager connection. - Answers JDBC API
With the code below, indicate JDBC coding best practices that have been violated (this code does
compile and run!):
import java.sql.*;
public class StudentData{public static void main(String[] args) {ResultSet rs = null;Statement stmt =
null;Connection conn = null;try {Class.forName("org.postgresql.Driver");conn =
DriverManager.getConnection(args[2], args[0], args[1]);stmt = conn.createStatement();rs =
stmt.executeQuery("SELECT * FROM Student WHERE rollno='" + args[3] + "'");while (rs.next())
{System.out.print(rs.getInt(1) + "\t");System.out.print(rs.getString(2) + "\t
");System.out.print(rs.getInt(3) + "\t ");System.out.println(rs.getDate(4));}stmt.close();stmt =
null;rs.close();rs = null;}catch (Exception exc) {exc.printStackTrace();}}} - Answers Answers 1-6 all apply
In JDBC, it is a good practice to use standard SQL statement and avoid using db specific query until
necessary. - Answers true
Which statement about JDBC is true? - Answers JDBC stands for Java Database Connectivity
Match the resource type with the best description - Answers Represents the socket between client and
server
Connection
Represents a query to the database
Statement
Corresponds to a cursor in the database server
ResultSet
Represents a pre-compiled and/or parameterized query
Prepared Statement
Which of the following are not benefits of XML over traditional relational data modelling? - Answers
Support for Large Objects (LOBs)
When XML is used as a DDL, we want to ensure the XML conforms to this so structural constraints may
be specified: - Answers DTD or XML Schema
, The type of XML Parsing that is parses an XML document based on expression and is used extensively in
conjunction with XSLT. - Answers XPath Parsing
On the XML below, which XPath expression will return all of the values of title attributes?
<slideshowtitle="Sample Slide Show"date="Date of publication"author="Yours Truly"><!-- TITLE SLIDE --
><slide type="all"><title>Wake up to WonderWidgets!</title></slide><!-- OVERVIEW --><slide
type="all"><title>Overview</title><item>Why <em>WonderWidgets</em> are great</item><item>Who
<em>buys</em> WonderWidgets</item></slide></slideshow> - Answers //@title
Well formed XML document means - Answers must contain one or more elements and root element
must contain all other elements
A transaction is delimited by statements (or function calls) of the form __________. - Answers Begin
transaction and End transaction
All functional dependencies must _________. - Answers have attributes of the same table
Assume that a relation R has the following properties. What is the normal form of R?
No multi-valued attributes
No partial key dependencies - Answers Second Normal Form
Assume that a relation R has the following properties. What is the normal form of R?
Has no multi-valued attributes
Has no partial key dependencies
Has attributes with atomic domains
Has transitive dependencies - Answers 1NF & 2NF
Considering functional dependency, one in which removal from some attributes must affect dependency
is called ________. - Answers full functional dependency
During translation of SQL queries into relational algebra queries, Anti-join is used for unnesting
________ subqueries. - Answers NOT EXISTS, NOT IN, ALL
During translation of SQL queries into relational algebra queries, Semi-join is used for unnesting
________ subqueries. - Answers EXISTS, IN, ANY
In the __________ normal form, a composite attribute is converted to individual attributes. - Answers
First
Query Processing involves which of the following steps: - Answers Scanning query tokens