Spring MCQ Quiz Hub

Spring Mcq Set 11

Choose a topic to test your knowledge and improve your Spring skills

1. Spring supports most of the popular ORM (or data mapper) frameworks.




2. ORM which isn’t supported by Spring:-




3. An ORM framework persists your objects according to the mapping metadata you provide.




4. Database Engine which uses low memory consumption and easy configuration.




5. Mode which Derby prefers to run in:-




6. For testing purposes, the client/server mode is more appropriate.




7. To start the Derby server in the client/server mode.




8. JDBC Properties for Connecting to the Application Database.




9. The general purpose of the Data Access Object (DAO) pattern is to avoid these logic related problems by separating data access logic from business logic and presentation logic.




10. To access the database with JDBC:-




11. Standard interface defined by the JDBC specification that factories Connection instances.




12. Data source implementations provided by different vendors and projects.




13. Spring also provides several convenient but less powerful data source implementations.




14. SingleConnectionDataSource (a DriverManagerDataSource subclass). As its name indicates, this maintains only a single connection.




15. Which DataSource is not stable in MultiThreaded Environment?




16. Class which declares a number of overloaded update() template methods to control the overall update process.




17. You implement this interface to override the statement creation task.




18. When implementing the PreparedStatementCreator interface, you will get the database connection as the createPreparedStatement() method’s argument.




19. It is better to implement the PreparedStatementCreator interface and other callback interfaces as inner classes if they are used within one method only.




20. PreparedStatementSetter, as its name indicates, create a PreparedStatement object on this connection the parameter as well as binding task of the overall update process.




21. The JdbcTemplate class offers template method for batch update operations.




22. The JdbcTemplate class declares a number of overloaded query() template methods to control the overall query process.




23. The primary interface that allows you to process the current row of the result set




24. RowCallbackHandler purpose is to map a single row of the result set to a customized object.




25. Method of RowMapper interface in which, you have to construct the object that represents a row and return it as the method’s return value.




26. RowMapper implementation which can automatically map a row to a new instance of the specified class.




27. Method which provides list of maps.




28. Spring JDBC framework offers a convenient class, to simplify your DAO implementation.




29. The org.springframework.jdbc.core.support.JdbcDaoSupport class has a setDataSource() method and a setJdbcTemplate() method.




30. Method to retrieve the JDBC template.




31. JdbcTemplate that takes advantage of Java 1.5 features such as autoboxing, generics, and variable-length arguments to simplify its usage.




32. JdbcTemplate require statement parameters to be passed as an object array.




33. To use SimpleJdbcTemplate:-




34. SimpleJdbcTemplate offers a convenient batch update method in the form of:-




35. Method has a warning from the Java compiler because of an unchecked conversion from List to List.




36. The return type of the queryForObject() method will be determined by the class argument (e.g., String.class).




37. Named SQL parameters are specified by name (starting with a colon) rather than by position.




38. Named parameters are supported only in SimpleJdbcTemplate.




39. Implementations of the SqlParameterSource interface:-




40. The Spring framework offers a consistent data access exception-handling mechanism for its data access module.




41. In your DAO methods, you neither need to surround the code with a try/catch block nor declare throwing an exception in the method signature.




42. The direct parent class of DataAccessException is:-




43. Which concrete exception in the DataAccessException hierarchy should be thrown?




44. Error code for The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint.




45. How does the Spring JDBC framework know that state 23505 should be mapped to DuplicateKeyException?




46. Class which represents a real-world entity and its instances will be persisted to a database.




47. Each entity class to be persisted by an ORM framework, a default constructor with no argument is required.




48. If the identifier value is null, this entity will be treated as a new and unsaved entity.




49. To allow the identifier to be null, you should choose a primitive wrapper type:-




50. A set of persistent annotations for you to define mapping metadata.