Multiple databases and SQL reference checks

Answered

I'm working on a Spring application deployed on Tomcat. There are 2 data sources defined in the Tomcat context XML and exposed via JNDI. One is a SQL Server datasource and the other is an Oracle data source.

I first added the SQL Server database in the "Database" toolbar and the SQL validation works as expected for SQL and it correctly validates and provides code completion. I then added the Oracle database but in my Java class which connects to the Oracle database it reports the columns as missing.

I've validated that the connection to the Oracle database within IntelliJ is fine because I can open a new console window and do a select query.

Do I need to somehow associate the class to be validated with a specific database? I've already specified the SQL dialect of the Java classes but that doesn't seem to make a difference.

1 comment
Comment actions Permalink

Hi Fu Leow,

>I then added the Oracle database but in my Java class which connects to the Oracle database it reports the columns as missing.

Do you see those Oracle tables and columns in Database tool window? Please make sure that the schema where those objects are present is selected in Database tool window.

Also please specify, do you have similar database names or schema names for those two data sources, set up in project?

Can you attach screenshot of editor, showing the issue and screenshot of Database tool window? Thanks

0

Please sign in to leave a comment.