JDBC Practice Questions: Test Your Knowledge of Cursors, URLs, and Prepared Statements
Practice Questions
-
Which one of the following methods is used to move the cursor to a particular row in a result set? a. absolute() b. first() c. isFirst() d. relative()
-
Which one of the following components of the JDBC URL indicates the vendor of RDBMS? a. Subname b. Supername c. Subprotocol name d. Superprotocol name
-
Identify the field of the Result Set interface that specifies the cursor to be scrollable and does not reflect the changes in the data. a. TYPE_SCROLL_INSENSITIVE b. TYPE_FORWARD_ONLY c. TYPE_SCROLL_SENSITIVE d. TYPE_READ_ONLY
-
Identify the method of the PreparedStatement interface that sets the Java byte type value for the parameter corresponding to the specified index. a. setByte(int index, byte val) b. setBytes(int index, byte[]val) c. setString(int index, String val) d. setShort(int index, short val)
-
Which method of the Connection interface is used to create the PreparedStatement object? a. prepareCall() b. getMetaData() c. prepareStatement() d. createStatement()
Answers:
- a. absolute()
- c. 'Subprotocol name'
- a. TYPE_SCROLL_INSENSITIVE
- a. setByte(int index, byte val)
- c. prepareStatement()
原文地址: https://www.cveoy.top/t/topic/ozhP 著作权归作者所有。请勿转载和采集!