fastcodejava
fastcodejava

Reputation: 41087

Schema in sql with spring jdbc

Is it necessary to always put Schema in sql queries? The SimpleJdbcTemplate seems to work on local with schema but fails in other machine. What could be the reason? Database is oracle and it is running on JBoss AS.

Upvotes: 1

Views: 269

Answers (1)

sehrope
sehrope

Reputation: 1777

The SQL syntax is dependent only on the type of database. For Oracle you do not need to specify a schema if the referenced object (e.g. table, view) is in your current schema or a local or public synonym exists for it. If not then you have to reference the object as [schema].[object].

Upvotes: 1

Related Questions