The SYSCS_UTIL.SYSCS_CREATE_USER system procedure adds a new user account to a database.
This procedure creates users for use with NATIVE authentication. For details about NATIVE authentication, see derby.authentication.provider and "Configuring NATIVE authentication" in the Derby Security Guide.
If NATIVE authentication is not already turned on when you call this procedure:
SYSCS_UTIL.SYSCS_CREATE_USER(IN USERNAME VARCHAR(128), IN PASSWORD VARCHAR(32672))
No result set is returned by this procedure.
If authentication and SQL authorization are both enabled, only the database owner has execute privileges on this procedure by default. See "Configuring NATIVE authentication," "Configuring user authentication," and "Configuring user authorization" in the Derby Security Guide for more information. The database owner can grant access to other users.
Create a user named FRED:
CallableStatement cs = conn.prepareCall ("CALL SYSCS_UTIL.SYSCS_CREATE_USER(?, ?)"); cs.setString(1, "fred"); cs.setString(2, "fredpassword"); cs.execute(); cs.close();
Create a user named FreD:
CallableStatement cs = conn.prepareCall ("CALL SYSCS_UTIL.SYSCS_CREATE_USER(?, ?)"); cs.setString(1, "\"FreD\""); cs.setString(2, "fredpassword"); cs.execute(); cs.close();
Create a user named FRED:
CALL SYSCS_UTIL.SYSCS_CREATE_USER('fred', 'fredpassword')
Create a user named FreD:
CALL SYSCS_UTIL.SYSCS_CREATE_USER('"FreD"', 'fredpassword')