on 2024 Sep 02 9:37 AM
I am currently developing a Custom adapter for the SAP CPI. Now I want to access an SQL-server over a Cloud Connector. I only found a guid how to access Tcp-Connections in general (Accessing On-Premise Application using Cloud Connector | SAP Help Portal). But using this would lose the capsulation provided by the Jdbc Material store. So, is there a way to access the Information stored in the Jdbc Material while developing a custom adapter?
Request clarification before answering.
It is incredibly easy if you know SAP CI uses OSGi:
javax.sql.DataSource ds = new InitialContext().lookup(
"osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=YOUR-NAME)",
) as javax.sql.DataSource
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the clue. But i still don't get how to address my Jdbc store in particular. My Jdbc material is called db1 the connection works i tested it with the standard jdbc adapter. So, I tried to get my connection with:
private javax.sql.DataSource ds = ((javax.sql.DataSource) new InitialContext().lookup("osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=db1)"));
but nothing sems to exist under that name.
next, i tried to get a list of all jndi services in the context with:
but only got:
So, I'm not quite sure were to go from here.
User | Count |
---|---|
24 | |
22 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.