Question 1. 1. (TCOs 1, 5, and 6) To add a database driver to a NetBeans project
ID: 3822813 • Letter: Q
Question
Question 1.1. (TCOs 1, 5, and 6) To add a database driver to a NetBeans project, you can add the JAR file for the driver to what folder? (Points : 4) The Source Packages folderThe Libraries folder
The Files folder
The Services folder Question 2.2. (TCOs 1–6) _____ represents an entity in the real world that can be distinctly identified. (Points : 4) A class
An object
A data field
A method Question 3.3. (TCOs 1–6) Which of the following statements is true regarding the following code assuming a proper database connection has been made and the statement object properly created?
ResultSet resultSet = statement.executeQuery("select firstName, mi, lastName from Student");
System.out.println(resultSet.getString(1)); (Points : 4) resultSet.getString(1) returns the lastName field in the result set.
If the SQL SELECT statement returns no result, resultSet is null.
resultSet.getString(1) returns the mi field in the result set.
The program will have a runtime error, because the cursor in resultSet does not point to a row. You must use resultSet.next() to move the cursor to the first row in the result set. Subsequently, resultSet.next() moves the cursor to the next row in the result set. Question 4.4. (TCOs 1–6) What is the return value from the following?
stmt.executeUpdate("insert into T values (100, 'Smith')"); (Points : 4) An int value indicating how many rows are effected from the invocation
An object that contains the status of the execution
A value indicating whether the SQL statement has been executed successfully
Void Question 5.5. (TCOs 1–6) Invoking Class.forName method when the database driver has not been configured into the project may throw (Points : 4) ClassNotFoundException.
IOException.
SQLException.
RuntimeException. Question 6.6. (TCOs 1–6) Which of the following statements is used to create an object to write to a file named out.dat? (Points : 4) BufferedWriter outfile = new BufferedWriter(FileWriter("out.dat"));
BufferedWriter outfile = new BufferedWriter (new File("out.dat"));
BufferedWriter outfile = new BufferedWriter (new FileWriter("out.dat"));
BufferedWriter outfile = new BufferedWriter ("out.dat"); Question 7.7. (TCOs 1–6) Which type of exception occurs when creating a BufferedReader object for a nonexistent file? (Points : 4) FileNotExist
FileNotFound
FileNotExistException
FileNotFoundException Question 8.8. (TCOs 1–6) Which class can be used to read data into a text file? (Points : 4) BufferedReader
System
ReadFile
FileRead Question 9.9. (TCOs 1–6) Result set meta data are retrieved through (Points : 4) a Statement object.
a Connection object.
a ResultSet object.
a PreparedStatement object. Question 10.10. (TCOs 1–6) Which of the following statements is false? (Points : 4) All the methods in JRadioButton are inherited from javax.swing.AbstractButton.
You can use an icon on JRadioButton.
JButton and JRadioButton fire same types of events.
All the methods in JRadioButton are also in JButton. Question 11.11. (TCOs 1–6) The method _____ gets the contents of the text field txtName. (Points : 4) txtName.findString()
txtName.getText(s)
txtName.getString()
txtName.getText() Question 12.12. (TCOs 1–6) The method _____ appends a string s into the text area jta. (Points : 4) jta.appendText(s)
jta.append(s)
jta.setText(s)
jta.insertText(s) Question 13.13. (TCOs 1–6) Which of the following statements is false? (Points : 4) You can create a text field with a specified text.
You can disable editing on a text field.
You can specify the number of rows in a text field
You can specify the number of columns in a text field. Question 14.14. (TCOs 1–6) A JList object can be populated with data stored in a(n) _____ object. (Points : 4) ModelList
DefaultListModel
ListArray
DefaultModelList Question 15.15. (TCOs 1–6) The _____ method of a check box returns true if that button is “checked”. (Points : 4) isSelected()
getSelected()
Selected()
isChecked() Question 1.1. (TCOs 1, 5, and 6) To add a database driver to a NetBeans project, you can add the JAR file for the driver to what folder? (Points : 4) The Source Packages folder
The Libraries folder
The Files folder
The Services folder
Explanation / Answer
1)To add a database driver to a NetBeans project, you can add the JAR file for the driver to what folder?
Ans) The Libraries folder
2) _____ represents an entity in the real world that can be distinctly identified.
Ans) An object
3) Which of the following statements is true regarding the following code assuming a proper database connection has been made and the statement object properly created?
Ans) The program will have a runtime error, because the cursor in resultSet does not point to a row. You must use resultSet.next() to move the cursor to the first row in the result set. Subsequently, resultSet.next() moves the cursor to the next row in the result set.
4) What is the return value from the following?
Ans) An int value indicating how many rows are effected from the invocation
5) Invoking Class.forName method when the database driver has not been configured into the project may throw.
Ans) ClassNotFoundException.
6) Which of the following statements is used to create an object to write to a file named out.dat?
Ans) BufferedWriter outfile = new BufferedWriter (new FileWriter("out.dat"));
7) Which type of exception occurs when creating a BufferedReader object for a nonexistent file?
Ans) FileNotFoundException
8) Which class can be used to read data into a text file?
Ans) BufferedReader
9) Result set meta data are retrieved through
Ans) a ResultSet object.
10) Which of the following statements is false?
Ans) JButton and JRadioButton fire same types of events.
11) The method _____ gets the contents of the text field txtName.
Ans) txtName.getText()
12) The method _____ appends a string s into the text area jta
Ans) jta.append(s)
13) Which of the following statements is false?
Ans) You can specify the number of rows in a text field
14) A JList object can be populated with data stored in a(n) _____ object
Ans) ListArray
15) The _____ method of a check box returns true if that button is “checked”
Ans) isSelected()
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.