cancel
Showing results for 
Search instead for 
Did you mean: 

How to access MII data server from within a custom action

Former Member
0 Kudos

Hi there,

I want to develop a custom action and want to use the MII database connection pooling to access the database. The custom actions needs to process SQL queries (SELECT, INSERT, UPDATE, DELETE) and some batch processing (multiple INSERTs, ...).

Is there a way to do this via the MII data server?

Regards

Tobias

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Tobias,

Login to netweaver(<protocol>://<Server>:<Port>/nwa) and navigate to the following path:

Configuration-->Infrastructure-->ApplicationResources

Here you will find all the JDBC Datasource and aliases.

Search for the alias with name "XMIIDATASOURCE". This is the JDBC DataSource Alias which MII uses for the database connections.

you can either use this or create a new alias here for you use.

I would suggest that you create a new one.

Refer to this link to see how you can use this alias in the java code to get connection object and then query the database.

Getting a Connection to the Database - Using Java - SAP Library

If you want to connect to another database all together then you need to create a JDBC Custom DataSources first and then one alias for this custom data source.

Though I have not done this myself but this should work.

Regards,

Rohit Negi.

Former Member
0 Kudos

Hi Rohit,

thanks for your helpful answer. However, I want to use a different data server, not the data source MII is using for its internal tables.

I created a new data source from within the MII menu via data services -> data server. This data server connects to a completely different database using IDBC (SQL) connector.

Is there a way to use this data server from within a Java Custom Action? I know I can use the custom action to read the connection settings and establish a connection by myself, but I want to use the connection pooling provided by SAP MII, like the Fixed Query action block of the workbench.

Thanks again for your help.

Best regards,

Tobias

Former Member
0 Kudos

Hi Tobias,

One way which I can think of is making http calls to MII using Illuminator service.

Using this service you can make calls for query templates and also to data servers.

Refer the links for the URL of the Illuminator Service

URL Format for Queries - Content Development - SAP Library

Refer the link to see how to make http calls from java code:

How to send HTTP request GET/POST in Java

Regards,

Rohit Negi.

Former Member
0 Kudos

Hi Rohit,

thanks for your help. I will take a look at it.

Best regards,

Tobias

Answers (0)