I created a database called "movie_db", set the default schema for APP. Then create a sample table named "USERS".
My DB connection is as follows:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="url" value="jdbc:derby://localhost:1527/movie_db"/>
<property name="username" value="root"/>
<property name="password" value="pass"/>
</bean>
Now I want to write some tests and try to execute the following query:
SELECT * FROM USERS;
What I get:
java.sql.SQLSyntaxErrorException: Table/View 'USERS' does not exist.
When I specify the exact scheme that I use:
SELECT * FROM APP.USERS
everything is working fine.
How can I omit the schema name in my query?
UPDATE:
As Brian said, I created a user with the name of my default scheme and log in with that name. This is the easiest way to omit the schema name in the query. But if I want to use multiple circuits, the only way is to explicitly set the circuit.
source
share