Tag: programming languages

Questions Related to programming languages

  1. ejbCreate()

  2. ejbActivate()

  3. create()

  4. setSessionContext()

  5. getRollbackOnly()

  6. getEJBHome()


Correct Option: E,F
  1. findAllCustomers(…)

  2. removeTheCustomer(…)

  3. createCustomer(…)

  4. create()

  5. retrieveCustData(…)


Correct Option: A,B,C,D
  1. ObjectNotFoundException.

  2. An empty Collection will be returned.

  3. An entity would be created and a reference to that entity would be returned.

  4. EntityNotFoundException.


Correct Option: B
  1. The entity bean instance is deleted.

  2. The entity in the database is deleted.

  3. Both the entity and the entity bean instance survive, but that entity bean instance does not represent that entity anymore.

  4. Nothing happens; the container simply ignores the call.


Correct Option: B
  1. You cannot write JDBC code in the bean class to make a connection and send queries to any database.

  2. You cannot write JDBC code in the bean class to change the values of virtual persistent fields of your bean.

  3. You can write JDBC code and get connected to any database you want.

  4. You can write JDBC code to read the virtual persistent fields, but you cannot change their values.


Correct Option: B
  1. getEJBObject()

  2. getPrimaryKey()

  3. getEJBHome()

  4. getRollbackOnly()

  5. getUserTransaction()


Correct Option: A,B,C,D
  1. All entity bean instances of the same type (say CustomerBean) have the same Home, that is, an instance of an object that implements the home interface of this bean.

  2. A specific entity bean instance can be accessed by only one client at a time.

  3. If two clients wanted to access the same entity in the database concurrently, the container would make two entity bean instances to represent that entity.

  4. If two clients wanted to access the same entity in the database concurrently, the container would make one entity bean to represent that entity, and the two clients would get their own references to the same EJBObject correspondtwo clients would get their


Correct Option: A,D
  1. ejbCreate

  2. Home business methods

  3. Business methods exposed in the component interface

  4. ejbStore()

  5. None of the above


Correct Option: E

Given: import java.util.regex.; class Regex2 { public static void main(String[] args) { Pattern p = Pattern.compile(args[o]); Matcher m = p.matcher(args[1]); boolean b = false; while(b = m.find()) { System.out.print(m.start() + m.group()); } } } And the command line: java Regex2 "\d" ab34ef What is the result?

  1. 234

  2. 334

  3. 2334

  4. 0123456

  5. 01234456

  6. 12334567


Correct Option: E