wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

FSD Q3

Total questions: 114

Worksheet time: 57mins

Name
Class
Date
1.

Which packages contain the JDBC classes?

a)

java.jdbc and javax.jdbc

b)

java.jdbc and java.jdbc.sql

c)

java.sql and javax.sql

d)

java.rdb and javax.rdb

2.

How can you retrieve information from a ResultSet?

a)

By invoking the method get(…, String type) on the ResultSet, where type is the database type

b)

By invoking the method get(…, Type type) on the ResultSet, where Type is an object which represents a database type

c)

By invoking the method getValue(…), and cast the result to the desired Java type.

d)

By invoking the special getter methods on the ResultSet: getString(…), getInt (…), getDouble(…),…

3.

How can you execute a stored procedure in the database?

a)

Call method execute() on a CallableStatement object

b)

Call method executeProcedure() on a Statement object

c)

Call method execute() on a StoredProcedure object

d)

Call method run() on a ProcedureCommand object

4.

Which method is used to perform DML statements in JDBC?

a)

execute()

b)

executeQuery()

c)

executeUpdate()

d)

executeResult()

5.

Which of the following is correct about PreparedStatement?

a)

Prepared statements offer better performance, as they are pre-compiled.

b)

Prepared statements reuse the same execution plan for different arguments rather than creating a new execution plan every time.

c)

Prepared statements use bind arguments, which are sent to the database engine.

d)

All of the above.

6.

Which driver is efficient and always preferable for using JDBC applications?

a)

Type-4

b)

Type-3

c)

Type-2

d)

Type-1

7.

Which JDBC driver Type(s) is(are) the JDBC-ODBC bridge?

a)

Type 1

b)

Type 2

c)

Type 3

d)

Type 4

8.

Which packages contain the JDBC classes?

a)

java.jdbc and javax.jdbc

b)

java.jdbc and java.jdbc.sql

c)

java.sql and javax.sql

d)

java.rdb and javax.rdb

9.

Which type of Statement can execute parameterized queries?

a)

PreparedStatement

b)

ParameterizedStatement

c)

ParameterizedStatement and CallableStatement

d)

All kinds of Statements (i.e. which implement a sub interface of Statement)

10.

How can you retrieve information from a ResultSet?

a)

By invoking the method get(…, String type) on the ResultSet, where type is the database type

b)

By invoking the method get(…, Type type) on the ResultSet, where Type is an object which represents a database type

c)

By invoking the method getValue(…), and cast the result to the desired Java type.

d)

By invoking the special getter methods on the ResultSet: getString(…), getInt (…), getDouble(…),…

11.

How can you execute a stored procedure in the database?

a)

Call method execute() on a CallableStatement object

b)

Call method executeProcedure() on a Statement object

c)

Call method execute() on a StoredProcedure object

d)

Call method run() on a ProcedureCommand object

12.

Which method is used to perform DML statements in JDBC?

a)

execute()

b)

executeQuery()

c)

executeUpdate()

d)

executeResult()

13.

Which of the following is correct about PreparedStatement?

a)

Prepared statements offer better performance, as they are pre-compiled.

b)

Prepared statements reuse the same execution plan for different arguments rather than creating a new execution plan every time.

c)

Prepared statements use bind arguments, which are sent to the database engine.

d)

All of the above.

14.

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?

a)

Methods on the ResultSet class for retrieving SQL SELECT results as Java types.

b)

Methods on the PreparedStatement class for sending Java types as SQL statement parameters.

c)

Methods on the CallableStatement class for retrieving SQL OUT parameters as Java types.

d)

All mentioned above

15.

The performance of the application will be faster if you use PreparedStatement interface because query is compiled only once.

a)

True

b)

False

16.

Which method is used to establish the connection with the specified url in a Driver Manager class?

a)

public static void registerDriver(Driver driver)

b)

public static void deregisterDriver(Driver driver)

c)

public static Connection getConnection(String url)

d)

public static Connection getConnection(String url,String userName,String password)

17.

Which driver Network connection is indirect that a JDBC client makes to a middleware process that acts as a bridge to the DBMS server?

a)

JDBC-Net

b)

JDBC-ODBC bridge

c)

Native API as basis

d)

Native protocol as basis

18.

Which is used to call the stored procedures and functions?

a)

CallableStatement Interface

b)

PreparedStatement Interface

c)

All the above

d)

None of the above

19.

What is used to execute parameterized query?

a)

Statement interface

b)

PreparedStatement interface

c)

ResultSet interface

d)

None of the above

20.

ODBC stands for?

a)

Open database connection

b)

Open database concept

c)

Open database communications

d)

None of the above

21.

Which models do the JDBC API support for the database access?

a)

Two-tier models

b)

Three-tier models

c)

Both A & B

d)

None of the above

22.

Which of the following is used to rollback a JDBC transaction?

a)

rollback()

b)

rollforward()

c)

deleteTransaction()

d)

RemoveTransaction()

23.

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

a)

Fetch method

b)

Current method

c)

Next method

d)

Access method

24.

Which method is used to perform DML statements in JDBC?

a)

execute()

b)

executeQuery()

c)

executeUpdate()

d)

executeResult()

25.

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.

a)

1 ,3,4,2

b)

1,2,3,4

c)

1,4,3,2

d)

1,2,4,3

26.

Which of the following tasks are associated with JDBC library?

a)

Making a connection to a database.

b)

Creating SQL or MySQL statements.

c)

Executing SQL or MySQL queries in the database.

d)

All of these

27.

Expand JDBC

(a)  

28.

_____________ interface handles the communications with the database server

a)

DriverManager

b)

Driver

c)

Statement

d)

None of these

29.

___________ interface with all methods for contacting a database.

a)

ResultSet

b)

Statement

c)

Connection

d)

Driver

30.

The third step involved in JDBC application is ____________

a)

Execute Query

b)

Establish Connection

c)

importing packages

d)

Register the Driver

31.

In Type 2 Driver, JDBC API calls are converted into native _____________ API calls, which are unique to the database

a)

C/C++

b)

Java

c)

JavaScript

d)

Visual Programming

32.

Type 4 Driver is also called as (a)  

33.

_____________ driver talks with server-side middleware which then talks to the database

a)

Type 1

b)

Type 2

c)

Type 3

d)

Type 4

34.

(a)   should be imported to use SQL statements

35.

The most common approach to register a driver is to use Java's (a)   method.

36.

To open a connection, DriverManager. (a)   () is to be used.

37.

Which method returns an integer as its result?

a)

execute()

b)

executeUpdate()

c)

executeQuery()

d)

extract()

38.

Which interface will NOT accept input parameters

a)

Statement

b)

PreparedStatement

c)

CallableStatement

d)

PrepareStatement

39.

All parameters in JDBC are represented by the ? symbol, which is known as the (a)   .

40.

in a ResultSet object, the ___________ methods to retrieve the value of a given column.

a)

POST()

b)

GET()

c)

setXXX()

d)

getXXX()

41.

We bind values to _________ parameters with the setXXX methods

a)

OUT

b)

IN

c)

INPUT

d)

OUTPUT

42.

The corresponding SQL type for the boolean JAVA type is_____

a)

BOOLEAN

b)

BIT

c)

BOOL

d)

BYTE

43.

(a)   method returns the total number of columns in the ResultSet object.

44.

_____________interface is used to execute stored procedures.

a)

Statement

b)

PreparedStatement

c)

CallableStatement

d)

execute

45.

(a)   method is used to create an object of the class ResultSetMetaData.

46.

What JDBC stands for ?

a)

Java Database Connectivity

b)

Java Driver for Basic Connection

c)

Joint Database Connectivity

d)

Joint Driver for Basic Connection

47.

How many Types of JDBC-Drivers available ?

a)

5

b)

4

c)

3

d)

6

48.

Which JDBC Driver Type is the JDBC-ODBC bridge ?

a)

Type-4

b)

Type-3

c)

Type-2

d)

Type-1

49.

Which driver is called as thin-driver in JDBC ?

a)

Type-2

b)

Type-4

c)

Type-3

d)

Type-1

50.

Which driver is callled Native-API driver ?

a)

Type-4

b)

Type-2

c)

Type-3

d)

Type-1

51.

What are the correct sequence of steps to connect any database using JDBC ?

a)

import packages,load or register the driver class,establish connection,create the statement,execute queries,close the connection

b)

establish connection,import packages,load or register the driver class,execute queries,create the statement,close the connection

c)

create the statement,import the packages,establish connection,import packages,load or register the driver class,execute queries,close the connection

d)

establish connection,create the statement,import the packages,import packages,load or register the driver class,execute queries,close the connection

52.

Which of the following method is needed for loading a database driver in JDBC ?

a)

registerDriver() method

b)

Class.forName() method

c)

Both 1 and 2

d)

None of the above

53.

Which packages contain the JDBC classes?

a)

java.jdbc and javax.jdbc

b)

java.jdbc and java.jdbc.sql

c)

java.sql and javax.sql

d)

java.rdb and javax.rdb

54.

------------- method is used to execute any SQL Statement with a SELECT clause, that return the result of the query as a

a)

execute()

b)

executeQuery()

c)

executeUpdate()

d)

executeBatch()

55.

Which method is used to execute INSERT,DELETE,UPDATE and other SQL DDL commands such as CREATE or DROP Table?

a)

execute()

b)

executeQuery()

c)

executeUpdate()

d)

executeBatch()

56.

What is return type of executeUpdate() method ?

a)

int

b)

String

c)

Date

d)

ResultSet

57.

What are the different types of Statements available in JDBC?

a)

Statement

b)

PreparedStatement

c)

CallableStatement

d)

All of the above

58.

Which type of Statement can execute parameterized queries ?

a)

ParameterizedStatement

b)

PreparedStatement

c)

CallableStatement

d)

All kinds of Statements (i.e. which implement a sub interface of Statement)

59.

Which method returns ResultSet as output?

a)

execute()

b)

executeQuery()

c)

executeUpdate()

d)

executeBatch()

60.

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?

a)

Statement

b)

CallableStatement

c)

ResultSetMetaData

d)

MetaData

61.

What are the Interfaces available in JDBC?

a)

Connection interface

b)

PreparedStatement interface

c)

ResultSet interface

d)

ResultSet interface

62.

What are the methods in Statement Interface?

a)

public ResultSet executeQuery(String sql): is used to execute SELECT query. It returns the object of ResultSet.

b)

public int executeUpdate(String sql): is used to execute specified query, it may be create, drop, insert, update, delete etc.

c)

public boolean execute(String sql): is used to execute queries that may return multiple results.

d)

public int[] executeBatch(): is used to execute batch of commands.

63.

This method is for retrieving a String Value(SQL type VARCHAR) and assigning to String Object.

a)

getVarchar()

b)

getString()

c)

getObject()

d)

getInt()

64.

This language _______________was developed by ___________

a)

Hyper Text Mark up Language, Laudon

b)

Hyper Text Make up Language, Tim Berners Lee

c)

Hyper Text Mark Up Language, Tim Berners Lee

65.

A "Container Tag" in HTML has _________

a)

Only Ending Tag

b)

Only Starting Tag

c)

Both Starting and Ending Tag

d)

None

66.

An " Empty Tag" contains

a)

Break Tag

b)

Both Starting Tag and Ending Tag

c)

Only Starting Tag

d)

Only Ending Tag

67.

Saving a notepad file involves ________. (Select the relevant options)

a)

Adding an extension HTM or HTML

b)

Selecting all files in type

c)

Adding a name to file

d)

None

68.

<br> tag is a (a)   tag.

69.

Fundamental HTML Block is known as ___________.

a)

HTML Body

b)

HTML Tag

c)

HTML Attribute

d)

HTML Element

70.

All HTML Tags are enclosed in ____________

a)

# and #

b)

? and !

c)

< and >

d)

{ and }

71.

HTML is a basic language as compared to XML and Java

a)

True

b)

False

c)

May be

72.

HTML is flexible language.

a)

Yes

b)

No

c)

May Be

73.
a)

Head Tag

b)

Title Tag

c)

HTML Tag

d)

Body Tag

74.
What does HTML stand for?
a)
Hypertext Making Language
b)
Hyper Transfer Markup Language
c)
Hypertext Markup Language
d)
Hyper Transfer Making Language
75.
HTML Language uses
a)
Tabs
b)
Tags
c)
Punctuation
d)
Quotations
76.
A <tag>
a)
Is used to divide sections
b)
Is not needed in HTML
c)
Tells the browser how to format our content
d)
Is part of the title line in HTML
77.
<h> is
a)
Header Tag
b)
Headline Tag
c)
Half of a tag
d)
Closing header tag
78.
</h> is
a)
Header Tag
b)
Headline Tag
c)
Half of a tag
d)
Closing header tag
79.
New heading tags can be added by using;
a)
Letters (ie: ha; hb)
b)
Numbers (i.e: h1; h2)
c)
Quotations (ie: h'; h")
d)
You can't do this
80.
<p> is
a)
punctuation tag
b)
closing paragraph tag
c)
closing punctuation tag
d)
paragraph tag
81.
</p> is
a)
punctuation tag
b)
closing paragraph tag
c)
closing punctuation tag
d)
paragraph tag
82.
An attribute is a; 
a)
Applies changes to everything
b)
Different options for each tab
c)
Allows for no changes to the site
d)
Gives structure and text
83.
Style tags are used to;
a)
Apply style to one line
b)
Not used in HTML
c)
Used at the top of the page to apply a style to the entire document
d)
Used sparingly
84.
<style>
a)
Found at top of styling options
b)
Allows a heading to be written
c)
Allows the body to be written
d)
Allows attributes to be included
85.
</style>
a)
Found at the bottom of styling options
b)
Allows a heading to be written
c)
Allows the body to be written
d)
Allows attributes to be included
86.
Body tags are used;
a)
Used for only the header
b)
Used only for the paragraph
c)
element that wraps everything that is visible on the page.
d)
Not used in HTML
87.
<body>
a)
Body tag
b)
Paragraph tag
c)
Closing body tag
d)
Header tag
88.
</body>
a)
Body tag
b)
Paragraph tag
c)
Closing body tag
d)
Header tag
89.
A Header;
a)
Must include your name
b)
First Line of your code
c)
Found at bottom of your code
d)
Not needed in HTML
90.
<html>
a)
Gives you structure and text
b)
Not needed when creating HTML sites
c)
Goes after the <h1>
d)
Goes after the <body>
91.
</html>
a)
Found after </h1>
b)
Found after </style>
c)
Found after </body>
d)
Found at bottom of written code
92.
[Square brackets are used to define];
a)
An input attribute
b)
An export attribute
c)
A Function
d)
A Variable
93.
<img> tag finds;
a)
finds the image located at the a URL and the src attribute and then displays it.
b)
finds the image located at the SRC in the URL attribute and then displays it.
c)
Adds a cool picture
d)
Does not work in HTML coding
94.
Which of these is NOT a way HTML files access CSS files?
a)
Inline
b)
Style Tags
c)
External Stylesheet
d)
JavaScript
95.
If the page has a  <div style='padding: 10px;'> what type of CSS is this?
a)
Inline
b)
Style Tag
c)
External Stylesheet
d)
User Stylesheet
96.
A website has 3 CSS files on its page:
responsive.css
print.css
desktop.css
Why?
a)
Different CSS for different platforms
b)
Different CSS per browser
c)
To make the website run 3 times quicker
d)
Because it's impossible to use inline CSS
97.
What does this mean:
#main { background-color: red; }
a)
The object with ID of main has a background colour of red
b)
The object with CLASS main has a background colour of red
c)
All objects on the page are red
d)
The body of the page is red
98.
What does this mean:
A:hover { color: blue; }
a)
Links are blue when you hover over them
b)
Animations are blue when you hover over them
c)
The background colour of the body is blue when hovered
d)
There is no blue allowed on the page
99.
What is the main advantage of inline CSS?
a)
It's quicker to write
b)
It links to an external file
c)
You can write it in 3 languages
d)
There are no advantages
100.
Which of these is part of the Box model of CSS?
a)
DIV
b)
P
c)
TAG
d)
Padding
101.
Which of these is a benefit of using CSS?
a)
Can keep a consistent style across the site
b)
The website will have multiple objects
c)
There are no benefits
d)
The CSS will be JavaScript valid
102.
What does CSS stand for?
a)
Cascading Style Sheet
b)
Communicative Styling Saved
c)
Colour Style Selector
d)
Comparitive Site Style
103.
What is the latest Standard of CSS?
a)
CSS2
b)
CSS3
c)
CSS4
d)
CSS5
104.
How many CSS3 properties are there?
a)
345
b)
2323
c)
1
d)
100
105.

If we want define style for an unique element, then which css selector will we use ?

a)

Id

b)

text

c)

class

d)

name

106.

Which of the following property is used to control the repetition of an image in the background?

a)

background-repeat

b)

background-color

c)

background-image

d)

background-position

107.

Which of the following property is used to increase or decrease how bold or light a font appears?

a)

font-weight

b)

font-variant

c)

font-style

d)

font-family

108.

Which of the following property is used to set the width of an image?

a)

border

b)

height

c)

width

d)

-moz-opacity

109.

Which of the following property changes the color of right border?

a)

border-top-color

b)

border-left-color

c)

border-right-color

d)

border-bottom-color

110.

Which of the following property allows you to control the shape or appearance of the marker of a list?

a)

list-style-position

b)

list-style

c)

list-style-type

d)

list-style-image

111.

Which of the following selector selects an element that has no children?

a)

:empty

b)

:nochild

c)

:inheritance

d)

:no-child

112.

What type of selector is used in this case?

p {line-height: 150%;}

a)

class Selectors

b)

element Selectors

c)

id Selectors

d)

none of the mentioned

113.

By applying an ___________ a style can be applied to just a single tag.

a)

class rule

b)

element rule

c)

id rule

d)

none of the mentioned

114.

The _____________ attribute is used to define the name(s) of the class(es) to which a particular tag belongs.

a)

element

b)

class

c)

id

d)

none of the mentioned