欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

程序员文章站 2023-12-26 12:14:39
...
Next step is to enable MySQL's JDBC driver for OSGi , then deploy it to SMP 3.0 server, create OData Modeling & deploy to SMP server.

Enabling MySQL's JDBC driver for OSGi

  1. Since MySQL JDBC driver is not archived as OSGi bundle, so it can not be read and understood by SMP3 (as SMP3 is based on OSGi), hence to make it work we need to create an OSGi enabled bundle which includes MySQL JDBC driver.
  2. Download MySQL's JDBC driver from here .
  3. Open Eclipse>New>Other>Plug-in Development>Plug-in from Existing JAR Archives
  4. Click on ' Add External ' and browse to jar file

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

5. Provide some project name

    • Make sure you select Target Platform as Equinox
    • Uncheck unzip the JAR archives into the project

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

6. Once done, Right click project> Export>Plug-in Development>Deployable plug-ins and fragments

    • Define some location to store OSGi enabled jar file
    • Click on 'Finish'

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

Configure SMP 3.0 server for Integration Gateway JDBC connection

  • As already mentioned above, SMP3 is based on OSGi so it is very much possible to deploy any JDBC driver as OSGi enabled jar package on SMP runtime.

7. Copy the OSGi enabled jar file (in my case, it is at Desktop) , paste it into C:/SAP/MobilePlatform3/server/pickup

    • To verify if jar file has been deployed successfully, open . state folder and see the ' OK ' message

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

OData modeling

8. Make sure you have added GWPA plugin in the eclipse. For more information, checkthisdocument.

9. Create an OData project. File>New>Service Implementation Project

10. Check 'Create OData file manually ' option

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

11. Create a model file. Right Click Model>New>Other>OData model

    • Give some name for Model i.e. empModel
    • Make sure you have selected 'Blank OData Model ' from Initial Model content option
    • Click on 'Finish'.

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

12. Create an Entity model same like your table structure in backend system.

    • Make sure Entityset has the same name as Table name in database
    • All properties should have same name and data type as per table in the database

    • Change the EMPID data type to INT

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

13. Right click model>empModel.odata>Implement service

14. Right click empModel.odatasrv>Select Data source as JDBC

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

15. Right click project>Generate and Deploy Integration content

    • You may prefer any other name for Service Namespace. By default it is ' sap '.

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

Make sure you get a success message.

SMP 3.0 : Integration Gateway with MySQL Datasource (Part 2)_MySQL

NextPart 3

上一篇:

下一篇: