JAVA 14

COEP
Lets Crack Online Exam

IT Interview Exam Questions: JAVA 14 (IT Campus Placement)

Subject: JAVA 14

Part 14: List for questions and answers of JAVA

 

Q1. The JDBC-ODBC bridge is

a) Multithreaded

b) Singlethreaded

c) Both of the above

d) none of the above

 

Q2. Which statements about JDBC are true

a) JDBC is an API to connect to relational-, object- and XML data sources

b) JDBC stands for Java DataBase Connectivity

c) JDBC is an API to access relational databases

d) JDBC is an API to bridge the object-relational mismatch between OO programs and relational databases

 

Q3. 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

 

Q4. Which type of driver provides JDBC access via one or more ODBC drivers?

a) Type 1 driver

b) Type 2 driver

c) Type 3 driver

d) Type 4 driver

 

Q5. Which type of driver converts JDBC calls into the network protocol used by the database management system directly?

a) Type 1 driver

b) Type 2 driver

c) Type 3 driver

d) Type 4 driver

 

Q6. JDBC stands for:

a) Java Database Connectivity

b) Java Database Components

c) Java Database Control

d) None of the above is correct 

 

Q7. What MySQL property is used to create a surrogate key in MySQL?

a) UNIQUE

b) SEQUENCE

c) AUTO_INCREMENT

d) None of the above

 

Q8. ________ is an open source DBMS product that runs on UNIX, Linux and Windows

a) MySQL

b) JSP/SQL

c) JDBC/SQL

d) Sun ACCESS

 

Q9. Which JDBC driver Type(s) can be used in either applet or servlet code?

a) Both Type 1 and Type 2

b) Both Type 1 and Type 3

c) Both Type 3 and Type 4

d) Type 4 only

 

Q10. Where is metadata stored in MySQL?

a) In the MySQL database metadata

b) n the MySQL database metasql

c) In the MySQL database mysql

d) None of the above is correct

 

Q11. Which of the following methods are needed for loading a database driver in JDBC?

 a) registerDriver() method

b) Class.forName()

c) Both A and B

d) getConnection()

 

Q12. Which of the following statements is false as far as different type of statements is concern in JDBC?.

a) Regular Statement

b) Prepared Statement

c) Callable Statement

d) Interim Statement 

 

Q13. Which of the following allows non repeatable read in JDBC Connection?.

a) TRANSACTION_READ_UNCOMMITTED

b) TRANSACTION_READ_COMMITTED

c) TRANSACTION_SERIALIZABLE

d) TRANSACTION_REPEATABLE_READ

 

Q14. Which type of Statement can execute parameterized queries?

a) PreparedStatement

b) ParameterizedStatement

c) ParameterizedStatement and CallableStatement

d) All kinds of Statements

 

Q15. Which type of Statement can execute parameterized queries?

a) PreparedStatement

b) ParameterizedStatement

c) ParameterizedStatement and CallableStatement

d) All kinds of Statements

 

Q16. 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(…), getBoolean (…), getClob(…)

 

Q17. 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

 

Q18. What happens if you call the method close() on a ResultSet object?

a) the method close() does not exist for a ResultSet. Only Connections can be closed

b) the database and JDBC resources are released

c) you will get a SQLException, because only Statement objects can close ResultSets

d) the ResultSet, together with the Statement which created it and the Connection from which the Statement was retrieved, will be closed and release all database and JDBC resources 

 

Q19. What happens if you call deleteRow() on a ResultSet object?

a) The row you are positioned on is deleted from the ResultSet, but not from the database

b) The row you are positioned on is deleted from the ResultSet and from the database

c) The result depends on whether the property synchronizeWithDataSource is set to true or false

d) You will get a compile error: the method does not exist because you can not delete rows from a ResultSet

 

Q20. How many JDBC driver types does Sun define?

a) one

b) two

c) three

d) four 

 

Part 14: List for questions and answers of JAVA

 

Q1. Answer: a

 

Q2. Answer: b

 

Q3. Answer: c

 

Q4. Answer: c

 

Q5. Answer: d

 

Q6. Answer: a

 

Q7. Answer: c

 

Q8. Answer: a

 

Q9. Answer: c

 

Q10. Answer: c

 

Q11. Answer: c

 

Q12. Answer: d

 

Q13. Answer: d

 

Q14. Answer: a

 

Q15. Answer: a

 

Q16. Answer: d

 

Q17. Answer: a

 

Q18. Answer: b

 

Q19. Answer: b

 

Q20. Answer: d