Deck 24: Accessing Databases With JDBC

ملء الشاشة (f)
exit full mode
سؤال
If a query includes columns from multiple tables that have the same name, the statement must precede those column names with _________.

A) their database names.
B) their database names and a dot.
C) their table names and a dot.
D) their table names.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
To retrieve specific columns from a table, use _________ to separate the column names.

A) ?
B) *
C) ,
D) -
سؤال
When joining tables, the _________ clause specifies the columns from each table that are com?pared to determine which rows are merged.

A) ON
B) WHERE
C) LIKE
D) GROUP
سؤال
What is the name of a key in one table that is required to matche a primary key in another table?

A) Foreign key.
B) Matching key.
C) Joined key.
D) Linking key.
سؤال
A ________ is a column (or set of columns) which have a unique value that cannot be duplicated in other rows?

A) primary key.
B) query.
C) SQL statement.
D) lookup value.
سؤال
What is the relationship between a primary key and its corresponding foreign keys?

A) One-to-one.
B) Many-to-one.
C) Many-to-many.
D) One-to-many.
سؤال
The default sort order in a sorted query is _________.

A) ascending
B) descending
C) natural
D) None of the above
سؤال
Which symbol indicates that all columns should be retrieved?

A) ?
B) *
C) +
D) /
سؤال
Which SQL keyword is used to merge rows from multiple tables?

A) JOIN.
B) INNER JOIN.
C) GROUP.
D) MERGE.
سؤال
What does a primary key do?

A) Identifies each row of a table.
B) Selects a number of rows from a database.
C) Stores a bunch of related data.
D) None of the above.
سؤال
Which of the following is a key benefit of using JDBC?

A) It is a simple-to-use database management system.
B) Allows developers to change the underlying database without modifying the Java code.
C) It is a multi-platform database management system.
D) It provides a GUI for database management systems.
سؤال
Java programs communicate with databases using what API?

A) DBMS.
B) JDBC.
C) RDBMS.
D) Database.
سؤال
To obtain data from a table, you ________ the database?

A) select
B) query
C) get
D) None of the above
سؤال
The result of a query can be sorted by using the optional _________ clause.

A) ORDER BY
B) ORDER
C) SORT BY
D) SORT
سؤال
This keyword is used to add a row to a table.

A) INSERT.
B) ADD.
C) UPDATE.
D) CREATE.
سؤال
SQL uses the _________ as a delimiter for strings.

A) double quotes (" and ")
B) single quotes (' and ')
C) underscore (-)
D) percent (%)
سؤال
Pattern matching in a SQL query is performed with which clause?

A) FROM.
B) WHERE.
C) SELECT.
D) LIKE.
سؤال
Which of the following states the Rule of Entity Integrity?

A) Every row must have a value for the primary key and each value must be unique.
B) Every foreign key must appear as another table's primary key.
C) Every row must have a value for the primary key and values may be repeated.
D) None of the above.
سؤال
Which SQL keyword is required in every query?

A) FROM.
B) WHERE.
C) ORDER BY.
D) LIKE.
سؤال
Selection criteria can be added to a SQL query using which keyword?

A) FROM.
B) WHERE.
C) SELECT.
D) LIKE.
سؤال
Classes and interfaces for the JDBC API can be found in which package?

A) java.jdbc.
B) javax.jdbc.
C) java.sql.
D) java.sql.jdbc.
سؤال
What exception is thrown if the class loader cannot locate the driver class?

A) NoSuchClassException.
B) ClassCastException.
C) ClassNotFoundException.
D) IllegalClassException.
سؤال
PreparedStatement method ________ returns a ResultSet.

A) executeUpdate
B) executeQuery
C) execute
D) None of the above.
سؤال
JDBC 4 supports _______, so you do not need to manually load the database driver before accessing a database.

A) automatic driver downloading
B) automatic driver creation
C) automatic driver discovery
D) None of the above.
سؤال
Initially, a ResultSet cursor is positioned _________.

A) before the first row
B) at the first row
C) at the last row
D) after the last row
سؤال
In a PreparedStatement, parameters are counted from position ________.

A) 0
B) 1
C) 2
D) 3
سؤال
An implementation of the _________ interface configures the database connection and prepares query statements automatically.

A) ResultSet
B) RowSet
C) Both of the above
D) Neither of the above
سؤال
Which statement is false?

A) A DELETE statement removes rows from a table.
B) A DELETE statement must specify the table from which to delete.
C) A DELETE statement starts with the keyword DELETE.
D) A WHERE clause must be present in a DELETE statement.
سؤال
SQL statements that are stored in a database can be invoked using an object that implements interface ________.

A) Callable
B) StoredStatement
C) CallableStatement
D) Connection
سؤال
Transaction processing enables a program to ________ or ________ a transaction based on whether the transaction was successful.

A) save, delete
B) commit, rollback
C) save, rollback
D) commit, delete
سؤال
Which constants are used to indicate that a ResultSet is scrollable, insensitive to changes and read only?

A) TYPE_SCROLLABLE_INSENSITIVE, CONCUR_READ_ONLY.
B) TYPE_SCROLLABLEINSENSITIVE, CONCUR_READONLY.
C) TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY.
D) TYPE_SCROLL_INSENSITIVE, CONCUR_READONLY.
سؤال
In an UPDATE statement, the SET keyword is followed by _________.

A) a comma-separated list of column value-name pairs in the format value = columnName
B) a comma-separated list of column name-value pairs in the format columnName = value
C) a semicolon-separated list of column value-name pairs in the format value = columnName
D) a semicolon-separated list of column name-value pairs in the format columnName = value
سؤال
Transaction processing enables a program to treat a database operation, or set of operations, as single operation. This is known as a(n) ________ or a(n) ________.

A) atomic operation, unique operation.
B) unique operation, transaction.
C) atomic operation, transaction.
D) None of the above.
سؤال
What are individual SQL statements saved in a database called?

A) Stored statements.
B) Stored queries.
C) Stored commands.
D) Stored procedures.
سؤال
Which statement is false?

A) Interface JdbcRowSet is in the javax.rowset package.
B) A CachedRowSet object is scrollable and updatable by default.
C) A JdbcRowSet object is scrollable and updatable by default.
D) JdbcRowSet is a connected RowSet.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 24: Accessing Databases With JDBC
1
If a query includes columns from multiple tables that have the same name, the statement must precede those column names with _________.

A) their database names.
B) their database names and a dot.
C) their table names and a dot.
D) their table names.
C
2
To retrieve specific columns from a table, use _________ to separate the column names.

A) ?
B) *
C) ,
D) -
C
3
When joining tables, the _________ clause specifies the columns from each table that are com?pared to determine which rows are merged.

A) ON
B) WHERE
C) LIKE
D) GROUP
A
4
What is the name of a key in one table that is required to matche a primary key in another table?

A) Foreign key.
B) Matching key.
C) Joined key.
D) Linking key.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
5
A ________ is a column (or set of columns) which have a unique value that cannot be duplicated in other rows?

A) primary key.
B) query.
C) SQL statement.
D) lookup value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
6
What is the relationship between a primary key and its corresponding foreign keys?

A) One-to-one.
B) Many-to-one.
C) Many-to-many.
D) One-to-many.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
7
The default sort order in a sorted query is _________.

A) ascending
B) descending
C) natural
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
8
Which symbol indicates that all columns should be retrieved?

A) ?
B) *
C) +
D) /
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
9
Which SQL keyword is used to merge rows from multiple tables?

A) JOIN.
B) INNER JOIN.
C) GROUP.
D) MERGE.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
10
What does a primary key do?

A) Identifies each row of a table.
B) Selects a number of rows from a database.
C) Stores a bunch of related data.
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following is a key benefit of using JDBC?

A) It is a simple-to-use database management system.
B) Allows developers to change the underlying database without modifying the Java code.
C) It is a multi-platform database management system.
D) It provides a GUI for database management systems.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
12
Java programs communicate with databases using what API?

A) DBMS.
B) JDBC.
C) RDBMS.
D) Database.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
13
To obtain data from a table, you ________ the database?

A) select
B) query
C) get
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
14
The result of a query can be sorted by using the optional _________ clause.

A) ORDER BY
B) ORDER
C) SORT BY
D) SORT
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
15
This keyword is used to add a row to a table.

A) INSERT.
B) ADD.
C) UPDATE.
D) CREATE.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
16
SQL uses the _________ as a delimiter for strings.

A) double quotes (" and ")
B) single quotes (' and ')
C) underscore (-)
D) percent (%)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
17
Pattern matching in a SQL query is performed with which clause?

A) FROM.
B) WHERE.
C) SELECT.
D) LIKE.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
18
Which of the following states the Rule of Entity Integrity?

A) Every row must have a value for the primary key and each value must be unique.
B) Every foreign key must appear as another table's primary key.
C) Every row must have a value for the primary key and values may be repeated.
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which SQL keyword is required in every query?

A) FROM.
B) WHERE.
C) ORDER BY.
D) LIKE.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
20
Selection criteria can be added to a SQL query using which keyword?

A) FROM.
B) WHERE.
C) SELECT.
D) LIKE.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
21
Classes and interfaces for the JDBC API can be found in which package?

A) java.jdbc.
B) javax.jdbc.
C) java.sql.
D) java.sql.jdbc.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
22
What exception is thrown if the class loader cannot locate the driver class?

A) NoSuchClassException.
B) ClassCastException.
C) ClassNotFoundException.
D) IllegalClassException.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
23
PreparedStatement method ________ returns a ResultSet.

A) executeUpdate
B) executeQuery
C) execute
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
24
JDBC 4 supports _______, so you do not need to manually load the database driver before accessing a database.

A) automatic driver downloading
B) automatic driver creation
C) automatic driver discovery
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
25
Initially, a ResultSet cursor is positioned _________.

A) before the first row
B) at the first row
C) at the last row
D) after the last row
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
26
In a PreparedStatement, parameters are counted from position ________.

A) 0
B) 1
C) 2
D) 3
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
27
An implementation of the _________ interface configures the database connection and prepares query statements automatically.

A) ResultSet
B) RowSet
C) Both of the above
D) Neither of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
28
Which statement is false?

A) A DELETE statement removes rows from a table.
B) A DELETE statement must specify the table from which to delete.
C) A DELETE statement starts with the keyword DELETE.
D) A WHERE clause must be present in a DELETE statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
29
SQL statements that are stored in a database can be invoked using an object that implements interface ________.

A) Callable
B) StoredStatement
C) CallableStatement
D) Connection
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
30
Transaction processing enables a program to ________ or ________ a transaction based on whether the transaction was successful.

A) save, delete
B) commit, rollback
C) save, rollback
D) commit, delete
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
31
Which constants are used to indicate that a ResultSet is scrollable, insensitive to changes and read only?

A) TYPE_SCROLLABLE_INSENSITIVE, CONCUR_READ_ONLY.
B) TYPE_SCROLLABLEINSENSITIVE, CONCUR_READONLY.
C) TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY.
D) TYPE_SCROLL_INSENSITIVE, CONCUR_READONLY.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
32
In an UPDATE statement, the SET keyword is followed by _________.

A) a comma-separated list of column value-name pairs in the format value = columnName
B) a comma-separated list of column name-value pairs in the format columnName = value
C) a semicolon-separated list of column value-name pairs in the format value = columnName
D) a semicolon-separated list of column name-value pairs in the format columnName = value
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
33
Transaction processing enables a program to treat a database operation, or set of operations, as single operation. This is known as a(n) ________ or a(n) ________.

A) atomic operation, unique operation.
B) unique operation, transaction.
C) atomic operation, transaction.
D) None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
34
What are individual SQL statements saved in a database called?

A) Stored statements.
B) Stored queries.
C) Stored commands.
D) Stored procedures.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which statement is false?

A) Interface JdbcRowSet is in the javax.rowset package.
B) A CachedRowSet object is scrollable and updatable by default.
C) A JdbcRowSet object is scrollable and updatable by default.
D) JdbcRowSet is a connected RowSet.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.