databasespring-bootmybatisintersystems-cacheintersystems-iris

How to set Schema in mybatis for IRIS databse


My Intersystem IRIS database contains multiple schema i.e. Each Developer has his own Schema. While accessing database from Spring boot application I am getting following error:

 [SQLCODE: <-30>:<Table or view not found>]\r\n[Location: <Prepare>]\r\n[%msg: < Table 'SQLUSER.ACCOUNT' not found>]; nested exception is java.sql.SQLException: [SQLCODE: <-30>:<Table or view not found>]\r\n[Location: <Prepare>]\r\n[%msg: < Table 'SQLUSER.ACCOUNT' not found>]"

This is due to that fact that I am not able to specify schema before table name. If I hard code it as schema.table_name in code then the code is working fine.

Is there any way to set this Schema at global level through properties files for mybatis.


Solution

  • Unfortunately, there is no way to specify a current schema for the session. In InterSystems products supposed to use schema names all the time in all queries. And default schema for the whole system can be changed in settings.