Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When you're using the Apache Derby database, a table is always in a schema. If you don't specify a schema explicitly, Derby implicitly uses the built-in apps schema. A second built-in schema called sys which is used to isolate system tables. If you specify a user name A when creating the database, thinking about the scenario you are deploying a datasource and set the create database parameter as true, then you create a table T, the fully qualified name of the table T will be A.T.

When executing SQL commands upon a Derby database, always remember to specify the fully qualified name of the table. Otherwise, you might be experiencing certain SQLExceptions such as Connection authentication failure, especially when the username and the schema are not the same.

If you turn the derby authentication on and you still want to access the databases you created, make sure that a new group derby_DBname and its users are specified in the user name is defined in derbyadmin group within the groups.properties file, and the user's password defined in users.properties files as followed.

Panel
borderStylesolid
titlegroups.properties

admin=system,
derbyadmin=dbadmin
derby_DBname=user2,app,user1

Panel
borderStylesolid
titleusers.properties

system=manager
dbadmin=manager
app=app
user2 user1=password

where

  • dbadmin is the default derby system user.
  • app is the user name to access a table with the default APP schema.
  • user1
  • DBname is name of the database that user2 created.
  • user2 is name of the user when creating who creates the database DBname.
  • password is the plain text password of user user2 user1.

Note that if a database is created via Create DB button on the DB Manager portlet, the default schema is DBADMIN and its default owner is dbadmin.