Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans
  3. xmlns=
  4. "http://www.springframework.org/schema/beans"
  5. xmlns:xsi=
  6. "http://www.w3.org/2001/XMLSchema-instance"
  7. xmlns:context
  8. ="http://www.springframework.org/schema/context"
  9. xmlns:p=
  10. "http://www.springframework.org/schema/p"
  11. xmlns:tx=
  12. "http://www.springframework.org/schema/tx"
  13. xsi:schemaLocation=
  14. "http://www.springframework.org/schema/beans
  15. http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
  16. http://www.springframework.org/schema/context
  17. http://www.springframework.org/schema/context/spring-context-4.0.xsd
  18. http://www.springframework.org/schema/tx
  19. http://www.springframework.org/schema/tx/spring-tx.xsd
  20. http://www.springframework.org/schema/mvc
  21. http://www.springframework.org/schema/mvc/spring-mvc.xsd">
  22.  
  23. <!-- Enable Annotation based Declarative Transaction Management -->
  24. <tx:annotation-driven transaction-manager="transactionManager" />
  25.  
  26. <!-- Creating TransactionManager Bean, since JDBC we are creating of type DataSourceTransactionManager -->
  27. <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  28. <property name="dataSource" ref="dataSource" />
  29. </bean>
  30.  
  31. <!-- Initialization for data source -->
  32. <bean id="dataSource" class= "org.springframework.jdbc.datasource.DriverManagerDataSource">
  33. <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
  34. <property name="url" value="jdbc:mysql://localhost/bhaiyag_devgrocery"></property>
  35. <property name="username" value="newuser"></property>
  36. <property name="password" value="kim"></property>
  37. </bean>
  38.  
  39.  
  40. <bean id="CategoriesDaoImpl" class="org.kmsg.dao.daoImpl.CategoriesDaoImpl">
  41. <property name="dataSource" ref="dataSource"></property>
  42. </bean>
  43.  
  44. <bean id="CityDaoImpl" class="org.kmsg.dao.daoImpl.CityDaoImpl">
  45. <property name="dataSource" ref="dataSource"></property>
  46. </bean>
  47.  
  48. <bean id="CustomerDaoImpl" class="org.kmsg.dao.daoImpl.CustomerDaoImpl">
  49. <property name="dataSource" ref="dataSource"></property>
  50. </bean>
  51.  
  52. </beans>
  53.  
  54. public class CustomerOrderAdapter
  55. {
  56. public void displayCustomerOrder(String mobileNo)
  57. { }
  58.  
  59. @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = true)
  60. public Map<String, Object> createCustomerOrderData(SalesCommandObject salesCommandObject,long OrderForDelete) throws Exception
  61. {
  62. Map <String, Object> data = new HashMap<String, Object>();
  63. try
  64. {
  65. salesDaoImpl.deleteSalesitems(OrderNo);
  66. salesDaoImpl.deleteSales(OrderNo);
  67. salesDaoImpl.insertSalesItems(updatedOn,OrderNo,CustmobileNo);
  68.  
  69. salesDaoImpl.insertSales(totalSale, SlotNo, OrderNo);
  70.  
  71. }
  72. catch(IndexOutOfBoundsException ex)
  73. {
  74. System.out.println("No Record to Save");
  75. data.put("status", "No Record to Save");
  76. }
  77. catch(Exception e)
  78. {
  79. System.out.println(e.toString());
  80. data.put("status", e);
  81. }
  82. data.put("status", "Purchase Successfull");
  83. return data;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement