Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

@@ Question about Development standards I want the full example for the given da

ID: 3939638 • Letter: #

Question

@@

Question about Development standards I want the full example for the given data Separate deployment details from application context Try to divide operation details out of application context in other xml or properties file. Write the example code using beans. Question about Development standards I want the full example for the given data Use bean inheritance to reduce XML Using the parent attribute of the element and you can identify that a bean be a child of some other bean and inheriting the parent bean s properties and write the example code for it.

Explanation / Answer

Q5 answer :

Property file:

       <bean id="propertyConfigurer" class="org.springframework.beans. factory.config.PropertyPlaceholderConfigurer">

            <property name="location"><value>datasource.properties</value></property>

        </bean>

        <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">

            <property name="url"><value>${database.url}</value></property>

            <property name="driverClassName"><value>${database.driver}</value></property>

            <property name="username"><value>${database.user}</value></property>

            <property name="password"><value>${database.password}</value></property>

        </bean>

      

datasource.properties should contain the following entries: -

                database.url=jdbc:hsqldb:mydb

                   database.driver=org.hsqldb.jdbcDriver

                   database.user=hsql

                   database.password=password

     Jndi:

        <bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">

            <property name="jndiName" value="jdbc/myDataSource" />

        </bean>

Q6 answer:

<bean id="abstractTxDefinition" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" lazy-init="true">

    <property name="transactionManager">

        <ref bean="transactionManager"/>

    </property>

    <property name="transactionAttributeSource">

        <ref bean="attributeSource"/>

    </property>

</bean>

<bean id="myService" parent="abstractTxDefinition">

    <property name="target">

        <bean class="com.mycompany.MyServiceImpl">

    </property>

</bean>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote