Spring/Spring Mcq Set 11 Sample Test,Sample questions

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

1.-1

2.0

3.23505

4.1


Question:
 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.

1.True

2. False

3.none

4.all the mentoined


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

1.True

2. False

3.none

4.all the mentoined


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

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

2.org.springframework.jdbc.core.simple.SimpleJdbcTemplate

3. org.springframework.jdbc.*

4.none of the mentioned


Question:
 To access the database with JDBC:-

1. DAO interface

2.DAO Class

3.DataAccess interface

4.None of the mentioned


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

1.True

2.False

3.none

4.all the mentoined


Question:
 Which concrete exception in the DataAccessException hierarchy should be thrown?

1.errorCode

2. SQLState properties of the caught SQLException

3.All of the mentioned

4. none of the mentioned


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

1.JPA

2.JSR

3.XML

4. none of the mentioned


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

1.True

2.False

3.none

4.all the mentoined


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

1.org.springframework.jdbc.core.JdbcTemplate

2.org.springframework.jdbc.core.*

3.org.springframework.jdbc.*

4.none of the mentioned


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

1. entity

2. persistent

3. all of the mentioned

4.None of the mentioned


Question:
Data source implementations provided by different vendors and projects.

1. C3PO

2.Apache Commons DBCP

3. All of the mentioned

4.None of the mentioned


Question:
Database Engine which uses low memory consumption and easy configuration.

1.SQL

2.MySQL

3.Apache Derby

4.None of the mentioned


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

1. True

2. False

3.none

4.all the mentoined


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

1.True

2.False

3.none

4.all the mentoined


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

1.error code

2.SQL state

3.all of the mentioned

4. none of the mentioned


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

1.True

2.False

3.none

4.None of the mentioned


Question:
Implementations of the SqlParameterSource interface:-

1.MapSqlParameterSource

2.BeanPropertySqlParameterSource

3.none of the mentioned

4.All of the mentioned


Question:
JDBC Properties for Connecting to the Application Database.

1. Driver Class

2. URL

3.Username

4.All of the mentioned


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

1.True

2.False

3.none

4.all the mentoined


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

1.findAll()

2.query()

3.update()

4.batchUpdate()


Question:
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.

1.mapRow()

2. query()

3.update()

4.None of the mentioned


Question:
Method to retrieve the JDBC template.

1.setJdbcTemplate()

2.getTemplate()

3.getJdbc()

4.getJdbcTemplate()


Question:
Method which provides list of maps.

1. queryForList()

2. update

3.query()

4.All of the mentioned


Question:
Mode which Derby prefers to run in:-

1.embedded

2.client/server

3.all of the mentioned

4.None of the mentioned


Question:
Named parameters are supported only in SimpleJdbcTemplate.

1.True

2. False

3.all of the mentioned

4.None of the mentioned


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

1.True

2.False

3.none

4.all the mentoined


Question:
ORM which isn’t supported by Spring:-

1.Hibernate

2.JDO

3.TopLink

4.All of the mentioned


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

1.True

2. False

3.none

4.all the mentoined


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

1. True

2.False

3.none

4.all the mentoined


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

1.BeanPropertyRowMapper

2.BeanPropertyRow

3. All of the mentioned

4.None of the mentioned


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

1.Vector

2. Set

3.Map

4.List


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

1.True

2.False

3.none

4.all the mentoined


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

1.DriverManagerDataSource

2. DriverManagerData

3.DriverManagerDataAccess

4. DriverManagerDataSourceAccess


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

1.org.springframework.jdbc.core.support

2. org.springframework.jdbc.core.support.JdbcDaoSupport

3.all of the mentioned

4.None of the mentioned


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

1. Hibernate

2. JDO

3.JPA

4.All of the mentioned


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

1.javax.sql.DataAccess

2.javax.sql.DataSource

3. javax.sql.Data

4.javax.sql.DataSourceAccess


Question:
The direct parent class of DataAccessException is:-

1.RuntimeException

2.NestedRuntimeException

3.Exception

4.Throwable


Question:
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.

1.True

2. False

3.none

4.all the mentoined


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

1. True

2. False

3.none

4.all the mentoined


Question:
The JdbcTemplate class offers template method for batch update operations.

1.batchUpdate()

2.update()

3. all of the mentioned

4.None of the mentioned


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

1.True

2.False

3.none

4.all the mentoined


Question:
The primary interface that allows you to process the current row of the result set

1.PreparedStatementSetter

2.PreparedStatementCreator

3.PreparedStatementCreator

4.All of the mentioned


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

1.True

2.False

3.none

4.all the mentoined


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

1. True

2. False

3.none

4.None of the mentioned


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

1. java.lang.Integer

2. java.lang.Long

3.all of the mentioned

4.None of the mentioned


Question:
To start the Derby server in the client/server mode.

1.startNetworkServer java file

2.startNetworkServer script

3.startNetwork script

4.All of the mentioned


Question:
To use SimpleJdbcTemplate:-

1.instantiate it directly

2.retrieve its instance by extending the SimpleJdbcDaoSupport class

3. all of the mentioned

4.None of the mentioned


Question:
Which DataSource is not stable in MultiThreaded Environment?

1.DriverManagerDataSource

2. SingleConnectionDataSource

3.All of the mentioned

4.None of the mentioned


Question:
You implement this interface to override the statement creation task.

1.PreparedStatement

2.PreparedStatementCreator

3.PreparedCreator

4.None of the mentioned


More MCQS

  1. Spring Mcq Set 1
  2. Spring Mcq Set 2
  3. Spring Mcq Set 3
  4. Spring Mcq Set 4
  5. Spring Mcq Set 5
  6. Spring Mcq Set 6
  7. Spring Mcq Set 7
  8. Spring Mcq Set 8
  9. Spring Mcq Set 9
  10. Spring Mcq Set 10
  11. Spring Mcq Set 11
  12. Spring Mcq Set 12
  13. Spring Mcq Set 13
  14. Spring Mcq Set 14
  15. Spring Mcq Set 15
  16. Spring Mcq Set 16
  17. Spring Mcq Set 17
  18. Spring Mcq Set 18
  19. Spring Mcq Set 19
  20. Spring Mcq Questions
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!