Donate : Link

WordPress Blog : Link

Applications… : Link

  • We use Pointcut class to apply condition.
  • To implement Pointcut we have 2 classes.
    - StaticMethodMatcherPointcut
    - NameMetchMethodPointcut
  • * We can add target in AOP using setTarget() method and service using setInterceptorNames() method. In case if we have Pointcut then…


Donate : Link

WordPress Blog : Link

Applications… : Link

  • MethodBeforeAdvice, AfterReturningAdvice, MethodInterceptor example using XML
  • Open Eclipse
  • Go to File -> New -> Other… -> Java Project
  • Create AOP-Programmatic5 project
  • Right click on project -> Build Path -> Configure Build Path -> Libraries tab -> Add External JARs
    - aopalliance.jar

Donate : Link

WordPress Blog : Link

Applications… : Link

  • ThrowsAdvice example using Programmatic approach.
  • ThrowsAdvice: Throws Advice it is executed if actual method throws exception.
  • Open Eclipse
  • Go to File -> New -> Other… -> Java Project
  • Create AOP-Programmatic4 project
  • Right click on project -> Build Path -> Configure…

Donate : Link

WordPress Blog : Link

Applications… : Link

  • MethodInterceptor example using Programmatic approach.
  • MethodInterceptor: Around Advice it is executed before and after the actual method call.
  • Open Eclipse
  • Go to File -> New -> Other… -> Java Project
  • Create AOP-Programmatic3 project
  • Right click on project -> Build Path…

Donate : Link

WordPress Blog : Link

Applications… : Link

  • AfterReturningAdvice example using Programmatic approach
  • AfterReturningAdvice: After Advice it is executed after the actual method call. If method returns a value, it is executed after returning value.
  • Open Eclipse
  • Go to File -> New -> Other… -> Java Project
  • Create…

Donate : Link

WordPress Blog : Link

Applications… : Link

  • MethodBeforeAdvice example using Programmatic approach
  • MethodBeforeAdvice: Before Advice it is executed before the actual method call.
  • Open Eclipse
  • Go to File -> New -> Other… -> Java Project
  • Create AOP-Programmatic1 project
  • Right click on project -> Build Path -> Configure…

Donate : Link

WordPress Blog : Link

Applications… : Link

  • * AOP means Aspect Oriented Programming. The main aim of AOP is maintain independent business layer and service layer, seperate services from business.
    - Aspect = A service.
    - Advice = Service provider.
    - Point cut = A point/condition to execute aspects for…

Donate : Link

WordPress Blog : Link

Applications… : Link

  • * Below are the implementations provider and implementations for connection pool. …

Donate : Link

WordPress Blog : Link

Applications… : Link

Difference between JDBC and Spring JDBC

JDBC

  • All the exceptions are compiletime exception (CE)
  • CE is java.sql.SQLException (It will print database exceptions).
  • User must need to close connection.
  • Jdbc PreparedStatement is type safe.
  • For select operation always it will return ResultSet.

Spring JDBC

  • All the exceptions are runtime exception (RE).
  • RE is DataAccessException (It will print database exceptions). It is in spring-dao.jar file.
  • User no need to close connection.
  • All JdbcTemplate methods are type safe using Types class.
  • Generic select methods for all type of select operations.

Donate : Link

WordPress Blog : Link

Applications… : Link

  • DAO — Data Access Object it will do data persistence operations. It will interact RDBMS machines, interact with XML files, interact with LDAP machines, interact with NoSQL machines.
  • The main aim of DAO is data access operation.
  • * In DAO…

Code Factory

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store