Tag: programming languages

Questions Related to programming languages

Which of the following is NOT a step in the Hibernate communication with RDBMS?

  1. Create HQL Query

  2. Execute query to get list containing Java objects

  3. Load the Hibernate configuration file and create configuration object

  4. Create session from configuration object

  5. Get one session from the session factory


Correct Option: A,B,C,E

AI Explanation

To answer this question, you need to understand the steps involved in Hibernate communication with RDBMS.

Let's go through each option to understand why it is correct or incorrect:

Option A) Create HQL Query - This option is incorrect because creating an HQL (Hibernate Query Language) query is indeed a step in Hibernate communication with RDBMS. HQL is a language similar to SQL but specifically designed for querying Hibernate-managed entities.

Option B) Execute query to get list containing Java objects - This option is incorrect because executing a query to retrieve a list of Java objects is another step in Hibernate communication with RDBMS. Hibernate translates the HQL query into SQL and executes it against the database to retrieve the desired data.

Option C) Load the Hibernate configuration file and create configuration object - This option is incorrect because loading the Hibernate configuration file and creating a configuration object is an essential step in Hibernate communication with RDBMS. The configuration file contains information about the database connection, mapping information, and other Hibernate-specific settings.

Option D) Create session from configuration object - This option is correct because creating a session from the configuration object is indeed a step in Hibernate communication with RDBMS. The session represents a single-threaded context for executing database operations.

Option E) Get one session from the session factory - This option is incorrect because getting a session from the session factory is also a step in Hibernate communication with RDBMS. The session factory is responsible for creating and managing sessions.

Based on the above analysis, the correct answer is option A,B,C,E.

Which of the following is not a Session method?

  1. Session.saveorupdate()

  2. Session.remove()

  3. Session.load()

  4. Session.save()


Correct Option: B
  1. Productivity

  2. Maintainability

  3. Vendor dependence

  4. Performance


Correct Option: A,B,D

What is the file extension you use for hibernate mapping file?

  1. filename.hbm.xml

  2. filename.cfg.xml

  3. filename.hmb.xml

  4. filename.cfg.hbm.xml


Correct Option: A

Who are responsible for creating channels and receiving messages from the layer below or from the network?

  1. Channel Communication

  2. Channel Factory

  3. Channel Formatter

  4. Channel listeners


Correct Option: D

TransportWithMessageCredential is not available for the given binding?

  1. BasicHttpBinding

  2. WSFederationHttpBinding

  3. NetNamedPipeBinding

  4. WSHttpBinding


Correct Option: C

What is the default serialize for the WCF ?

  1. DataContractSerializer

  2. XMLSerializer

  3. DataContractFormatter

  4. None of the above


Correct Option: A

You are developing a Calculator service which performs mathematical operation. How you can enable session in your WCF Calculator Service?

  1. [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples", SessionMode=SessionMode.Required)] public interface ICalculator{ [OperationContract] double AddTo(double n); }

  2. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] public class CalculatorService : ICalculator { double result = 0.0D; public double AddTo(double n) { return result+=n; } }

  3. a and b both

  4. None of the above


Correct Option: C