Font size
WorksheetsFSD Q3
Total questions: 114
Worksheet time: 57mins
Which packages contain the JDBC classes?
java.jdbc and javax.jdbc
java.jdbc and java.jdbc.sql
java.sql and javax.sql
java.rdb and javax.rdb
How can you retrieve information from a ResultSet?
By invoking the method get(…, String type) on the ResultSet, where type is the database type
By invoking the method get(…, Type type) on the ResultSet, where Type is an object which represents a database type
By invoking the method getValue(…), and cast the result to the desired Java type.
By invoking the special getter methods on the ResultSet: getString(…), getInt (…), getDouble(…),…
How can you execute a stored procedure in the database?
Call method execute() on a CallableStatement object
Call method executeProcedure() on a Statement object
Call method execute() on a StoredProcedure object
Call method run() on a ProcedureCommand object
Which method is used to perform DML statements in JDBC?
execute()
executeQuery()
executeUpdate()
executeResult()
Which of the following is correct about PreparedStatement?
Prepared statements offer better performance, as they are pre-compiled.
Prepared statements reuse the same execution plan for different arguments rather than creating a new execution plan every time.
Prepared statements use bind arguments, which are sent to the database engine.
All of the above.
Which driver is efficient and always preferable for using JDBC applications?
Type-4
Type-3
Type-2
Type-1
Which JDBC driver Type(s) is(are) the JDBC-ODBC bridge?
Type 1
Type 2
Type 3
Type 4
Which packages contain the JDBC classes?
java.jdbc and javax.jdbc
java.jdbc and java.jdbc.sql
java.sql and javax.sql
java.rdb and javax.rdb
Which type of Statement can execute parameterized queries?
PreparedStatement
ParameterizedStatement
ParameterizedStatement and CallableStatement
All kinds of Statements (i.e. which implement a sub interface of Statement)
How can you retrieve information from a ResultSet?
By invoking the method get(…, String type) on the ResultSet, where type is the database type
By invoking the method get(…, Type type) on the ResultSet, where Type is an object which represents a database type
By invoking the method getValue(…), and cast the result to the desired Java type.
By invoking the special getter methods on the ResultSet: getString(…), getInt (…), getDouble(…),…
How can you execute a stored procedure in the database?
Call method execute() on a CallableStatement object
Call method executeProcedure() on a Statement object
Call method execute() on a StoredProcedure object
Call method run() on a ProcedureCommand object
Which method is used to perform DML statements in JDBC?
execute()
executeQuery()
executeUpdate()
executeResult()
Which of the following is correct about PreparedStatement?
Prepared statements offer better performance, as they are pre-compiled.
Prepared statements reuse the same execution plan for different arguments rather than creating a new execution plan every time.
Prepared statements use bind arguments, which are sent to the database engine.
All of the above.
In order to transfer data between a database and an application written in the Java programming language, the JDBC API provides which of these methods?
Methods on the ResultSet class for retrieving SQL SELECT results as Java types.
Methods on the PreparedStatement class for sending Java types as SQL statement parameters.
Methods on the CallableStatement class for retrieving SQL OUT parameters as Java types.
All mentioned above
The performance of the application will be faster if you use PreparedStatement interface because query is compiled only once.
True
False
Which method is used to establish the connection with the specified url in a Driver Manager class?
public static void registerDriver(Driver driver)
public static void deregisterDriver(Driver driver)
public static Connection getConnection(String url)
public static Connection getConnection(String url,String userName,String password)
Which driver Network connection is indirect that a JDBC client makes to a middleware process that acts as a bridge to the DBMS server?
JDBC-Net
JDBC-ODBC bridge
Native API as basis
Native protocol as basis
Which is used to call the stored procedures and functions?
CallableStatement Interface
PreparedStatement Interface
All the above
None of the above
What is used to execute parameterized query?
Statement interface
PreparedStatement interface
ResultSet interface
None of the above
ODBC stands for?
Open database connection
Open database concept
Open database communications
None of the above
Which models do the JDBC API support for the database access?
Two-tier models
Three-tier models
Both A & B
None of the above
Which of the following is used to rollback a JDBC transaction?
rollback()
rollforward()
deleteTransaction()
RemoveTransaction()
The method on the result set that tests whether or not there remains at least one unfetched tuple in the result set, is said to be
Fetch method
Current method
Next method
Access method
Which method is used to perform DML statements in JDBC?
execute()
executeQuery()
executeUpdate()
executeResult()
Which of the following describes the correct sequence of the steps involved in making a connection with a database.
1. Loading the driver
2. Process the results.
3. Making the connection with the database.
4. Executing the SQL statements.
1 ,3,4,2
1,2,3,4
1,4,3,2
1,2,4,3
Which of the following tasks are associated with JDBC library?
Making a connection to a database.
Creating SQL or MySQL statements.
Executing SQL or MySQL queries in the database.
All of these
Expand JDBC
(a)
_____________ interface handles the communications with the database server
DriverManager
Driver
Statement
None of these
___________ interface with all methods for contacting a database.
ResultSet
Statement
Connection
Driver
The third step involved in JDBC application is ____________
Execute Query
Establish Connection
importing packages
Register the Driver
In Type 2 Driver, JDBC API calls are converted into native _____________ API calls, which are unique to the database
C/C++
Java
JavaScript
Visual Programming
Type 4 Driver is also called as (a)
_____________ driver talks with server-side middleware which then talks to the database
Type 1
Type 2
Type 3
Type 4
(a) should be imported to use SQL statements
The most common approach to register a driver is to use Java's (a) method.
To open a connection, DriverManager. (a) () is to be used.
Which method returns an integer as its result?
execute()
executeUpdate()
executeQuery()
extract()
Which interface will NOT accept input parameters
Statement
PreparedStatement
CallableStatement
PrepareStatement
All parameters in JDBC are represented by the ? symbol, which is known as the (a) .
in a ResultSet object, the ___________ methods to retrieve the value of a given column.
POST()
GET()
setXXX()
getXXX()
We bind values to _________ parameters with the setXXX methods
OUT
IN
INPUT
OUTPUT
The corresponding SQL type for the boolean JAVA type is_____
BOOLEAN
BIT
BOOL
BYTE
(a) method returns the total number of columns in the ResultSet object.
_____________interface is used to execute stored procedures.
Statement
PreparedStatement
CallableStatement
execute
(a) method is used to create an object of the class ResultSetMetaData.
What JDBC stands for ?
Java Database Connectivity
Java Driver for Basic Connection
Joint Database Connectivity
Joint Driver for Basic Connection
How many Types of JDBC-Drivers available ?
5
4
3
6
Which JDBC Driver Type is the JDBC-ODBC bridge ?
Type-4
Type-3
Type-2
Type-1
Which driver is called as thin-driver in JDBC ?
Type-2
Type-4
Type-3
Type-1
Which driver is callled Native-API driver ?
Type-4
Type-2
Type-3
Type-1
What are the correct sequence of steps to connect any database using JDBC ?
import packages,load or register the driver class,establish connection,create the statement,execute queries,close the connection
establish connection,import packages,load or register the driver class,execute queries,create the statement,close the connection
create the statement,import the packages,establish connection,import packages,load or register the driver class,execute queries,close the connection
establish connection,create the statement,import the packages,import packages,load or register the driver class,execute queries,close the connection
Which of the following method is needed for loading a database driver in JDBC ?
registerDriver() method
Class.forName() method
Both 1 and 2
None of the above
Which packages contain the JDBC classes?
java.jdbc and javax.jdbc
java.jdbc and java.jdbc.sql
java.sql and javax.sql
java.rdb and javax.rdb
------------- method is used to execute any SQL Statement with a SELECT clause, that return the result of the query as a
execute()
executeQuery()
executeUpdate()
executeBatch()
Which method is used to execute INSERT,DELETE,UPDATE and other SQL DDL commands such as CREATE or DROP Table?
execute()
executeQuery()
executeUpdate()
executeBatch()
What is return type of executeUpdate() method ?
int
String
Date
ResultSet
What are the different types of Statements available in JDBC?
Statement
PreparedStatement
CallableStatement
All of the above
Which type of Statement can execute parameterized queries ?
ParameterizedStatement
PreparedStatement
CallableStatement
All kinds of Statements (i.e. which implement a sub interface of Statement)
Which method returns ResultSet as output?
execute()
executeQuery()
executeUpdate()
executeBatch()
Which java.sql class or interface contains methods that enable you to find out the number of columns this is returned in a ResultSet and the name or label for a given column?
Statement
CallableStatement
ResultSetMetaData
MetaData
What are the Interfaces available in JDBC?
Connection interface
PreparedStatement interface
ResultSet interface
ResultSet interface
What are the methods in Statement Interface?
public ResultSet executeQuery(String sql): is used to execute SELECT query. It returns the object of ResultSet.
public int executeUpdate(String sql): is used to execute specified query, it may be create, drop, insert, update, delete etc.
public boolean execute(String sql): is used to execute queries that may return multiple results.
public int[] executeBatch(): is used to execute batch of commands.
This method is for retrieving a String Value(SQL type VARCHAR) and assigning to String Object.
getVarchar()
getString()
getObject()
getInt()
This language _______________was developed by ___________
Hyper Text Mark up Language, Laudon
Hyper Text Make up Language, Tim Berners Lee
Hyper Text Mark Up Language, Tim Berners Lee
A "Container Tag" in HTML has _________
Only Ending Tag
Only Starting Tag
Both Starting and Ending Tag
None
An " Empty Tag" contains
Break Tag
Both Starting Tag and Ending Tag
Only Starting Tag
Only Ending Tag
Saving a notepad file involves ________. (Select the relevant options)
Adding an extension HTM or HTML
Selecting all files in type
Adding a name to file
None
<br> tag is a (a) tag.
Fundamental HTML Block is known as ___________.
HTML Body
HTML Tag
HTML Attribute
HTML Element
All HTML Tags are enclosed in ____________
# and #
? and !
< and >
{ and }
HTML is a basic language as compared to XML and Java
True
False
May be
HTML is flexible language.
Yes
No
May Be
Head Tag
Title Tag
HTML Tag
Body Tag
src attribute and then displays it.responsive.css
print.css
desktop.css
Why?
#main { background-color: red; }
A:hover { color: blue; }
If we want define style for an unique element, then which css selector will we use ?
Id
text
class
name
Which of the following property is used to control the repetition of an image in the background?
background-repeat
background-color
background-image
background-position
Which of the following property is used to increase or decrease how bold or light a font appears?
font-weight
font-variant
font-style
font-family
Which of the following property is used to set the width of an image?
border
height
width
-moz-opacity
Which of the following property changes the color of right border?
border-top-color
border-left-color
border-right-color
border-bottom-color
Which of the following property allows you to control the shape or appearance of the marker of a list?
list-style-position
list-style
list-style-type
list-style-image
Which of the following selector selects an element that has no children?
:empty
:nochild
:inheritance
:no-child
What type of selector is used in this case?
p {line-height: 150%;}
class Selectors
element Selectors
id Selectors
none of the mentioned
By applying an ___________ a style can be applied to just a single tag.
class rule
element rule
id rule
none of the mentioned
The _____________ attribute is used to define the name(s) of the class(es) to which a particular tag belongs.
element
class
id
none of the mentioned
