Advertisement
Guest User

Untitled

a guest
Oct 12th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
  4. xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
  6. xmlns:task="http://www.springframework.org/schema/task"
  7. xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd">
  8.  
  9. <context:annotation-config />
  10.  
  11. <bean id="driver" class="com.dbAbstract.driver.Mysql">
  12.  
  13. </bean>
  14.  
  15. <bean id="dbDriver" class="com.dbAbstract.generic.DbDriver">
  16.  
  17. </bean>
  18.  
  19. <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  20. <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  21. <property name="url" value="jdbc:mysql://localhost:3306/" />
  22. <property name="username" value="root" />
  23. <property name="password" value="" />
  24. </bean>
  25. </beans>
  26.  
  27. public class DbDriver {
  28.  
  29. protected IDriver driver;
  30.  
  31. @Autowired
  32. public void setDriver(Mysql paramDriver){
  33. this.driver = paramDriver;
  34. }
  35. }
  36.  
  37. public class Schema extends DbDriver implements ISchema {
  38. public void doSomething(){
  39. // Inherited from DbDriver
  40. this.driver.dosth();
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement