Web Design and Development MCQs with Answers
Practice important Web Design and Development MCQs with answers and explanations.
Chapter: 16
Q261:
Which of these can be used to identify a thread?
A. Thread Id
B. Thread Name
C. Thread Priority
D. All of the above
Correct Answer:
D
Chapter: 16
Q262:
_______ is the method to make a thread wait for another thread to finish.
A. wait()
B. notify()
C. join()
D. notifyAll()
Correct Answer:
C
Chapter: 16
Q263:
How do you create a scrollable and updatable ResultSet in Java?
A. By using ResultSet.TYPE_FORWARD_ONLY and ResultSet.CONCUR_READ_ONLY
B. By using ResultSet.TYPE_SCROLL_INSENSITIVE and ResultSet.CONCUR_UPDATABLE
C. By using ResultSet.TYPE_SCROLL_INSENSITIVE and ResultSet.CONCUR_READ_ONLY
D. By using ResultSet.TYPE_FORWARD_ONLY and ResultSet.CONCUR_UPDATABLE
Correct Answer:
B
Chapter: 17
Q264:
Which method should be called to update the underlying database with the new contents of the current row?
A. moveToInsertRow()
B. insertRow()
C. updateRow()
D. deleteRow()
Correct Answer:
C
Chapter: 17
Q265:
What does the previous() method do in a scrollable ResultSet?
A. Moves the cursor to the previous row
B. Moves the cursor to the next row
C. Moves the cursor to the first row
D. Moves the cursor to the last row
Correct Answer:
A
Chapter: 17
Q266:
What is the purpose of the updateRow() method in ResultSet?
A. To update the ResultSet in memory only
B. To delete the current row from the ResultSet
C. To insert a new row into the ResultSet
D. To update the underlying database with the new contents of the current row
Correct Answer:
D
Chapter: 17
Q267:
What does metadata describe in the context of data?
A. The data itself
B. Information about the data
C. The algorithm used for processing data
D. The software used for data analysis
Correct Answer:
B
Chapter: 17
Q268:
How can ResultSetMetaData help in a database query?
A. It provides query results directly
B. It gives information about column names
C. It executes SQL queries
D. It provides database connection details
Correct Answer:
B
Chapter: 17
Q269:
Which method of ResultSetMetaData returns the number of columns?
A. getColumnName()
B. getColumnCount()
C. getColumnDisplaySize()
D. getColumnType()
Correct Answer:
B
Chapter: 17
Q270:
How can you obtain the maximum width of a column in ResultSetMetaData?
A. getColumnName(int)
B. getColumnLabel(int)
C. getColumnDisplaySize(int)
D. getColumnType(int)
Correct Answer:
C
Chapter: 17
Q271:
What does the getColumnType(int) method return?
A. The SQL type of the column
B. The name of the column
C. The display size of the column
D. The database product name
Correct Answer:
A
Chapter: 17
Q272:
How do you access metadata about a database in JDBC?
A. By calling getMetaData() on a ResultSet
B. By calling getMetaData() on a Connection
C. By executing a SQL query
D. By using the ResultSet object directly
Correct Answer:
B
Chapter: 17
Q273:
Which JDBC driver type translates JDBC calls into ODBC calls?
A. Type-1 JDBC-ODBC Bridge
B. Type-2 Native API/partly Java driver
C. Type-3 Net-protocol/all-Java driver
D. Type-4 Native-protocol/all-Java driver
Correct Answer:
A
Chapter: 17
Q274:
___________ is the process of making multiple threads execute in a specific order.
A. Scheduling
B. Serialization
C. Synchronization
D. None of the above
Correct Answer:
C
Chapter: 17
Q275:
What is a characteristic of Type-2 JDBC drivers?
A. They are purely Java-based
B. They convert JDBC calls to database-specific calls
C. They use a network middle-tier server
D. They are less efficient than Type-1 drivers
Correct Answer:
B
Chapter: 17
Q276:
What is the main advantage of Type-4 JDBC drivers?
A. They are platform-independent
B. They translate calls into ODBC calls
C. They use database-specific APIs
D. They rely on a middle-tier server
Correct Answer:
A
Chapter: 17
Q277:
What does the isReadOnly() method of DatabaseMetaData check?
A. The read/write mode of the database
B. The version of the database product
C. The name of the JDBC driver
D. The number of columns in the ResultSet
Correct Answer:
A
Chapter: 17
Q278:
What method is used to get the database product name from DatabaseMetaData?
A. getDatabaseProductName()
B. getDatabaseProductVersion()
C. getDriverName()
D. getDatabaseType()
Correct Answer:
A
Chapter: 17
Q279:
What does the getDriverName() method return in DatabaseMetaData?
A. The name of the JDBC driver
B. The name of the database product
C. The version of the database product
D. The read-only status of the database
Correct Answer:
A
Chapter: 17
Q280:
How does a Type-3 JDBC driver handle database requests?
A. Sends requests through a middle-tier server
B. Directly communicates with the database
C. Converts JDBC calls into ODBC calls
D. Uses a database-specific API
Correct Answer:
A