0

programming languages Online Quiz - 72

Description: programming languages Online Quiz - 72
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

window.location.href="www.google.com". The given statement when executed would result in one of the following:

  1. It will give an error

  2. It will execute and nothing will happen

  3. It will execute and www.google.com is going to open

  4. None of The above


Correct Option: C
  1. When browser is closed

  2. When the page reloads as well.

  3. Only when you navigate out of the page.

  4. All Of the Above


Correct Option: D

One can add custom method and properties to objects in javascript without using prototype as well.

  1. True

  2. False


Correct Option: B

Please select right set of technologies that are required for implementing Dynamic Content or DHTML in your application

  1. HTML

  2. CSS

  3. Javascript

  4. Ajax


Correct Option: A,B

Does hibernate allow mixing table-per-class hierarchy and table-per-subclass strategies?

  1. Yes

  2. No

  3. Can't say

  4. None of the above


Correct Option: B

AI Explanation

To answer this question, you need to understand the table-per-class hierarchy and table-per-subclass strategies in Hibernate.

In Hibernate, there are different strategies for mapping inheritance relationships between classes and database tables. The table-per-class hierarchy strategy maps the entire inheritance hierarchy to a single table, using additional columns to differentiate between different subclasses. On the other hand, the table-per-subclass strategy maps each subclass to its own table, with the common attributes in the superclass being duplicated in each subclass table.

Now, let's go through each option to understand why it is correct or incorrect:

Option A) Yes - This option is incorrect because Hibernate does not allow mixing the table-per-class hierarchy and table-per-subclass strategies. You have to choose one strategy for the entire inheritance hierarchy.

Option B) No - This option is correct. Hibernate does not allow mixing the table-per-class hierarchy and table-per-subclass strategies.

Option C) Can't say - This option is incorrect because it is possible to determine whether Hibernate allows mixing these strategies or not.

Option D) None of the above - This option is incorrect because the correct answer is B) No.

The correct answer is B) No. This option is correct because Hibernate does not allow mixing the table-per-class hierarchy and table-per-subclass strategies.

Which statement is correct ?

  1. session.contains() method to determine if an instance belongs to the session cache.

  2. session.contains() method to determine if an instance belongs to the data base

  3. Both are correct

  4. none of the above


Correct Option: A

What does session.evict() method do ?

  1. Remove the object and its collections from the first level cache

  2. Remove the object and its collections from the second level cache

  3. Remove the object and its collections from the data base

  4. None of the above


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Remove the object and its collections from the first level cache - This option is correct. The session.evict() method in Hibernate removes the object and its collections from the first level cache. The first level cache, also known as the session cache, is associated with the Hibernate session and holds the persistent objects loaded from the database. By evicting the object, you are removing it from the first level cache, and subsequent operations on that object will result in database queries to fetch the object again.

Option B) Remove the object and its collections from the second level cache - This option is incorrect. The session.evict() method does not directly remove the object from the second level cache. The second level cache is a shared cache and is not specific to a particular session. Objects in the second level cache can be accessed by multiple sessions, and removing an object from the first level cache does not automatically remove it from the second level cache.

Option C) Remove the object and its collections from the database - This option is incorrect. The session.evict() method does not remove the object from the database. It only removes it from the first level cache. If you want to delete an object from the database, you would use the session.delete() method instead.

Option D) None of the above - This option is incorrect. Option A is the correct answer.

The correct answer is A) Remove the object and its collections from the first level cache. This option is correct because the session.evict() method in Hibernate removes the object and its collections from the first level cache.

Is the Session threadsafe in Hibernate ?

  1. TRUE

  2. FALSE

  3. No matter

  4. None of the above


Correct Option: B

How can you make a property be read from the database but not modified in anyway

  1. By using the insert="false" and update="false" attributes

  2. By using the isinsert="false" and isupdate="false" attributes.

  3. By using the isinsert="no" and isupdate="no" attributes

  4. None


Correct Option: A
  1. A Session will not obtain a JDBC Connection (or a Datasource) unless it is needed

  2. A Session will obtain a JDBC Connection (or a Datasource) on object create

  3. A Session has no relation with JDBC Connection (or a Datasource)

  4. None of the above


Correct Option: A

How to enable query cache in hibernate

  1. Hibernate.cache.query_cache true

  2. Hibernate.cache.use_query_cache true

  3. Hibernate.cache.query_cache yes

  4. None


Correct Option: B

Which statement is correct?

  1. Bag has index column

  2. Bag permits duplicate element values

  3. Bag does not permits duplicate element values

  4. None


Correct Option: B
  1. ListResultSet

  2. ResultSet

  3. ScrollableResultSet

  4. ScrollableResult


Correct Option: D
  1. Mapping files can be added to Configuration in the application code

  2. They can be configured in hibernate.cfg.xml using the elements

  3. Both a and b

  4. None of the above


Correct Option: C

Select the output of the following SQL statement : SELECT RPAD(name,10,'x') from client_table where name='TEST';

  1. xxxxxxTEST

  2. TESTxxxxxx

  3. ' TEST'

  4. 'TEST '


Correct Option: B
- Hide questions