Scenario that explains why the select fails:
- The DB2 administrator, db2admin for example, connects to SAMPLE
database.
- Administrator creates a table called EMPLOYEE. Since DB2 uses the
username as the schema, the table is created as DB2ADMIN.EMPLOYEE.
- A WebSphere Application Server data source is created, using user ID
USER1.
- USER1 is granted permission to connect to the SAMPLE database.
- A servlet using this data source performs a SELECT * FROM EMPLOYEE.
Because the schema name is not specified, USER1 is used. As a result, the
select fails because USER1.EMPLOYEE does not exist.
Edit the db2cli.ini file and add an entry:
[SAMPLE]
CURRENTSCHEMA=DB2ADMIN
where SAMPLE is the database name and DB2ADMIN is the
actual schema for the tables.
|