Question
· May 2

is this possible to call routines(.mac) directly in java?

Hello, we are currently using the Cache Database released in January 2018.

There are no specific classes or SQL mappings in the namespaces where data is stored.

Only a few routines(.mac) and stored data are in the global area.

In this case, when accessing the Cache DB through Java, is it essential to write SQL mappings or wrapper classes? The reason I ask is that our team doesn't have advanced developers who specialize in Cache.

Alternatively, is it possible to directly call pre-existing routines from Java?

I apologize for the translation;

Product version: Caché 2018.1
Discussion (2)3
Log in or sign up to continue

Since you're using Cache, the options are "limited" compared to those in IRIS. Out of the box you can't call routines with the provided APIs, so you have the following options (can be combined depending on your needs):

- Create SQL mappings (classes)

- Expose the routines you want to call as stored procedure

- Create an "API" class in your system that expose the routines you want to call 

- Create an "API" class that exposes a generic method where you can pass the routine name and parameters (similar to what IRIS does)

- Create a REST API similar to the APIs in before points

- There may be other options

For the REST API, apart from making the Cache changes you won't need any other Cache libraries in your Java code. For the other options you'd need one of the libraries/options provided by cache https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls