Are You Recruiter/Hiring Manager?
Cloud-based Candidate Screening | Online Tests
PMP 1600 Questions
PMP 1600 Questions
1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

Tutorial Home

Hibernate

  • Advantage of Hibernate over JDBC
  • Hibernate Setup with an web Application
  • First Hibernate Application
  • Hibernate mapping with Database TABLE
  • Hibernate Data Type-Java Data Type - SQL Data Type mapping
  • One to Many Relation in Hibernate
  • One to Many Relation in Hibernate bi-directional
  • Many to Many Relation in Hibernate
  • HQL: The Hibernate Query Language
  • Criteria Queries
  • Criteria Queries : Equal (eq), Not Equal(ne), Less than (le), greater than (gt),greater than or equal(ge) and Ordering the results
  • Criteria Queries: And OR conditions
  • Hibernate generator to generate id (primary key)
  • prevent concurrent update in Hibernate,slate object updatation in Hibernate,version checking in Hibernate

    Struts


  • Model View Controller (MVC)
  • Model View Controller (MVC)
  • Struts Flow-How Struts Works?
  • Struts Tutorial - Struts Setup- First Struts Action class setup
  • Message Resources
  • Validation Framework
  • Validation Framework-client side
  • ForwardAction
  • IncludeAction
  • DispatchAction
  • LookupDispatchAction
  • DynaActionForm
  • DynaActionForm
  • Struts Tutorial - Mutli-click prevention using struts tokens-Prevent Duplicate Submission
  • Logic Iterate Map and List

    JSP


  • JSP Tutorial
  • Introduction to JSP
  • JSP Comments
  • JSP Syntax
  • JSP Scripting Elements :Scriptlet, expression, declaration
  • JSP Directives
  • implicit objects in JSP
  • JSP Actions
  • Introduction to JSP
  • jsp:useBean
  • The jsp:setProperty Action
  • The jsp:getProperty Action
  • Introduction to JSP

    Spring


  • Spring Tutorial
  • Introduction to Spring
  • Benefits of Using Spring Framework
  • Inversion of Control in Spring
  • Introduction to BeanFactory
  • Dependency Injection in Spring
  • Collections Setter Injection
  • Bean Scopes in Spring
  • Spring IOC Setup Step by Step
  • Bean Lifecycle in Spring
  • ApplicationContext
  • MessageSources in Spring
  • Web Spring MVC framework
  • Developing Your First Spring Web Application
  • Developing Your Second Spring Web Application with Spring Form
  • Developing Your First Spring Web Application with Spring Validation Framework with Code Example
  • Spring integration with Hibernate
  • Identify correct and incorrect statements about the purpose and use of the deployment descriptor elements for environment entries, EJB references, and resource manager connection factory references; including whether a given code listing is appropriate and correct with respect to a particular deployment descriptor element.

    An enterprise bean instance locates the environment naming context using the JNDI interfaces. An instance creates a javax.naming.InitialContext object by using the constructor with NO arguments, and looks up the environment naming via the InitialContext under the name java:comp/env. The enterprise bean's ENVIRONMENT ENTRIES are stored directly in the environment naming context, or in any of its direct or indirect subcontexts.

    
    public void setTaxInfo(int numberOfExemptions, ...)
    	throws InvalidNumberOfExemptionsException {
    	...
    	// Obtain the enterprise bean's environment naming context.
    	Context initCtx = new InitialContext();
    	Context myEnv = (Context)initCtx.lookup("java:comp/env");
    
    	// Obtain the maximum number of tax exemptions
    	// configured by the Deployer.
    	Integer max = (Integer)myEnv.lookup("maxExemptions");
    
    	// Obtain the minimum number of tax exemptions
    	// configured by the Deployer.
    	Integer min = (Integer)myEnv.lookup("minExemptions");
    
    	// Use the environment entries to customize business logic.
    	if (numberOfExeptions > Integer.intValue(max) ||
    		numberOfExemptions < Integer.intValue(min))
    		throw new InvalidNumberOfExemptionsException();
    
    	// Get some more environment entries. These environment
    	// entries are stored in subcontexts.
    	String val1 = (String)myEnv.lookup("foo/name1");
    	Boolean val2 = (Boolean)myEnv.lookup("foo/bar/name2");
    
    	// The enterprise bean can also lookup using full pathnames.
    	Integer val3 = (Integer)
    	initCtx.lookup("java:comp/env/name3");
    	Integer val4 = (Integer)
    	initCtx.lookup("java:comp/env/foo/name4");
    	...
    }
    
    				
    
    <session>
    	...
    	<ejb-name>EmployeeService</ejb-name>
    	<ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
    	...
    	<env-entry>
    		<description>
    			The maximum number of tax exemptions
    			allowed to be set.
    		</description>
    		<env-entry-name>maxExemptions</env-entry-name>
    		<env-entry-type>java.lang.Integer</env-entry-type>
    		<env-entry-value>15</env-entry-value>
    	</env-entry>
    
    	<env-entry>
    		<description>
    			The minimum number of tax exemptions
    			allowed to be set.
    		</description>
    		<env-entry-name>minExemptions</env-entry-name>
    		<env-entry-type>java.lang.Integer</env-entry-type>
    		<env-entry-value>1</env-entry-value>
    	</env-entry>
    
    	<env-entry>
    		<env-entry-name>foo/name1</env-entry-name>
    		<env-entry-type>java.lang.String</env-entry-type>
    		<env-entry-value>value1</env-entry-value>
    	</env-entry>
    
    	<env-entry>
    		<env-entry-name>foo/bar/name2</env-entry-name>
    		<env-entry-type>java.lang.Boolean</env-entry-type>
    		<env-entry-value>true</env-entry-value>
    	</env-entry>
    
    	<env-entry>
    		<description>Some description.</description>
    		<env-entry-name>name3</env-entry-name>
    		<env-entry-type>java.lang.Integer</env-entry-type>
    	</env-entry>
    
    	<env-entry>
    		<env-entry-name>foo/name4</env-entry-name>
    		<env-entry-type>java.lang.Integer</env-entry-type>
    		<env-entry-value>10</env-entry-value>
    	</env-entry>
    	...
    </session>
    
    				

    The following example illustrates how an enterprise bean uses an EJB REFERENCE to locate the remote home interface of another enterprise bean.

    public class EmployeeServiceBean implements SessionBean {
    	public void changePhoneNumber(...) {
    		...
    
    		// Obtain the default initial JNDI context.
    		Context initCtx = new InitialContext();
    
    		// Look up the home interface of the EmployeeRecord
    		// enterprise bean in the environment.
    		Object result = initCtx.lookup("java:comp/env/ejb/EmplRecord");
    
    		// Convert the result to the proper type.
    		EmployeeRecordHome emplRecordHome = (EmployeeRecordHome)
    			javax.rmi.PortableRemoteObject.narrow(result,
    			EmployeeRecordHome.class);
    
    		...
    	}
    }
    					
    
    <session>
    	...
    	<ejb-name>EmployeeService</ejb-name>
    	<ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
    	...
    	<ejb-ref>
    		<description>
    			This is a reference to the entity bean that
    			encapsulates access to employee records.
    		</description>
    		<ejb-ref-name>ejb/EmplRecord</ejb-ref-name>
    		<ejb-ref-type>Entity</ejb-ref-type>
    		<home>com.wombat.empl.EmployeeRecordHome</home>
    		<remote>com.wombat.empl.EmployeeRecord</remote>
    	</ejb-ref>
    
    	<ejb-ref>
    		<ejb-ref-name>ejb/Payroll</ejb-ref-name>
    		<ejb-ref-type>Entity</ejb-ref-type>
    		<home>com.aardvark.payroll.PayrollHome</home>
    		<remote>com.aardvark.payroll.Payroll</remote>
    	</ejb-ref>
    
    	<ejb-ref>
    		<ejb-ref-name>ejb/PensionPlan</ejb-ref-name>
    		<ejb-ref-type>Session</ejb-ref-type>
    		<home>com.wombat.empl.PensionPlanHome</home>
    		<remote>com.wombat.empl.PensionPlan</remote>
    	</ejb-ref>
    	...
    </session>
    
    					

    The following illustrates an ejb-link in the deployment descriptor. The Application Assembler uses the ejb-link element to indicate that the EJB reference EmplRecord declared in the EmployeeService enterprise bean has been linked to the EmployeeRecord enterprise bean.

    
    <session>
    	...
    	<ejb-name>EmployeeService</ejb-name>
    	<ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
    	...
    	<ejb-ref>
    		<ejb-ref-name>ejb/EmplRecord</ejb-ref-name>
    		<ejb-ref-type>Entity</ejb-ref-type>
    		<home>com.wombat.empl.EmployeeRecordHome</home>
    		<remote>com.wombat.empl.EmployeeRecord</remote>
    		<ejb-link>EmployeeRecord</ejb-link>
    	</ejb-ref>
    	...
    </session>
    
    ...
    
    <entity>
    	<ejb-name>EmployeeRecord</ejb-name>
    	<home>com.wombat.empl.EmployeeRecordHome</home>
    	<remote>com.wombat.empl.EmployeeRecord</remote>
    	...
    </entity>
    
    					

    The following example illustrates using the ejb-link element to indicate an enterprise bean reference to the ProductEJB enterprise bean that is in the same J2EE application unit but in a different ejb-jar file:

    
    <entity>
    	...
    	<ejb-name>OrderEJB</ejb-name>
    	<ejb-class>com.wombat.orders.OrderBean</ejb-class>
    	...
    	<ejb-ref>
    		<ejb-ref-name>ejb/Product</ejb-ref-name>
    		<ejb-ref-type>Entity</ejb-ref-type>
    		<home>com.acme.orders.ProductHome</home>
    		<remote>com.acme.orders.Product</remote>
    		<ejb-link>../products/product.jar#ProductEJB</ejb-link>
    	</ejb-ref>
    	...
    </entity>
    
    					

    The following code sample illustrates obtaining a JDBC connection:

    public class EmployeeServiceBean implements SessionBean {
    	EJBContext ejbContext;
    
    	public void changePhoneNumber(...) {
    		...
    
    		// obtain the initial JNDI context
    		Context initCtx = new InitialContext();
    
    		// perform JNDI lookup to obtain resource manager
    		// connection factory
    		javax.sql.DataSource ds = (javax.sql.DataSource)
    			initCtx.lookup("java:comp/env/jdbc/EmployeeAppDB");
    
    		// Invoke factory to obtain a connection. The security
    		// principal is not given, and therefore
    		// it will be configured by the Deployer.
    		java.sql.Connection con = ds.getConnection();
    		...
    	}
    }
    					

    The following example is the declaration of resource manager connection factory references used by the EmployeeService enterprise bean:

    
    <enterprise-beans>
    	<session>
    		...
    		<ejb-name>EmployeeService</ejb-name>
    		<ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
    		...
    		<resource-ref>
    			<description>
    				A data source for the database in which
    				the EmployeeService enterprise bean will
    				record a log of all transactions.
    			</description>
    			<res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
    			<res-type>javax.sql.DataSource</res-type>
    			<res-auth>Container</res-auth>
    			<res-sharing-scope>Shareable</res-sharing-scope>
    		</resource-ref>
    		...
    	</session>
    </enterprise-beans>
    
    					

    The following example illustrates the declaration of the JMS resource manager connection factory references:

    
    <enterprise-beans>
    	<session>
    		...
    		<resource-ref>
    			<description>
    				A queue connection factory used by the
    				MySession enterprise bean to send
    				notifications.
    			</description>
    			<res-ref-name>jms/QueueConnFactory</res-ref-name>
    			<res-type>javax.jms.QueueConnectionFactory</res-type>
    			<res-auth>Container</res-auth>
    			<res-sharing-scope>Unshareable</res-sharing-scope>
    		</resource-ref>
    		...
    	</session>
    </enterprise-beans>
    
    					

    The following example illustrates how an enterprise bean uses a RESOURCE ENVIRONMENT REFERENCE to locate a JMS Destination:

    public class StockServiceBean implements SessionBean {
    	public void processStockInfo(...) {
    		...
    
    		// Obtain the default initial JNDI context
    		Context initCtx = new InitialContext();
    
    		// Look up the JMS StockQueue in the environment.
    		Object result = initCtx.lookup("java:comp/env/jms/StockQueue");
    
    		// Convert the result to the proper type.
    		javax.jms.Queue queue = (javax.jms.Queue)result;
    	}
    }
    					
    In the example, the Bean Provider of the StockServiceBean enterprise bean has ASSIGNED the environment entry jms/StockQueue as the RESOURCE ENVIRONMENT REFERENCE name to refer to a JMS queue.

    The following example illustrates the declaration of RESOURCE ENVIRONMENT REFERENCES in the deployment descriptor:

    
    ...
    <resource-env-ref>
    	<description>
    		This is a reference to a JMS queue used in the
    		processing of Stock info
    	</description>
    	<resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
    	<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
    </resource-env-ref>
    ...
    
    					

    The information you are posting should be related to java and ORACLE technology. Not political.