UltraLite User's Guide
Developing UltraLite Applications
Adding user authentication to your application
Enabling user authentication requires the application to supply a valid UltraLite user ID and password when connecting to the UltraLite database. If you do not explicitly enable user authentication, UltraLite does not authenticate users.
To enable user authentication (embedded SQL)
Call ULEnableUserAuthentication before calling db_init. For example:
app(){ ... ULEnableUserAuthentication( &sqlca ); db_init( &sqlca ); ...
The call to db_init precedes all other database activity in the application.
To enable user authentication (C++ API)
Define the compiler directive UL_ENABLE_USER_AUTH when compiling ulapi.cpp.
Call ULEnableUserAuthentication before opening the database. For example:
ULData db; ... ULEnableUserAuthentication( &sqlca ); db.open(); ...
To enable user authentication (Java)
Call the JdbcSupport.enableUserAuthentication method before creating a new database object: For example:
JdbcSupport.enableUserAuthentication(); java.util.Properties p = new java.util.Properties(); p.put( "persist", "file" ); SampleDB db = new SampleDB( p );
Once you have enabled user authentication, you must add user management code to your application. For more information, see Managing user IDs and passwords.