Hi!
All DB functions located in libnxsrv in 1.0.x versions, and in separate library libnxdb in 1.1.x versions. They are defined in nxsrvapi.h (1.0.x) or nxdbapi.h (1.1.x). All functions require DB connection handle. You can either use global "default" handle (g_hCoreDB variable), or get handle from connection pool using function DBConnectionPoolAcquireConnection - this is the preferred method. Connections acquired from pool must be released with call to DBConnectionPoolReleaseConnection. Most of DB functions is straightforward. Two common patterns of usage are following:
1. Non-SELECT query: use DBQuery(handle, query); Function will return TRUE on success.
2. SELECT query: use DBSelect(handle, query); Function will return result set or NULL on failure. Then you can use DBGetNumRows(set) to get number of rows, DBGetValue(set, row, column, buffer, bufsize) (or any variations, like DBGetColumnLong) to retrieve data from set. When you finish, you must destroy result set by calling DBFreeResult(set);
In fact, there are audit log inside the server, it's just not accessible from management console. You can use server's function WriteAuditLog to add records to it.
Windows console is deprecated - I plan that 1.0.9 will be the last version with Windows management console as primary management tool. In 1.1.x branch, we are migrating to new cross-platform Java console. It is based on Eclipse, so it can be extended with plugins very easily. It's half-working already, and I hope to implement all functionality of legacy Windows console soon.
Best regards,
Victor
All DB functions located in libnxsrv in 1.0.x versions, and in separate library libnxdb in 1.1.x versions. They are defined in nxsrvapi.h (1.0.x) or nxdbapi.h (1.1.x). All functions require DB connection handle. You can either use global "default" handle (g_hCoreDB variable), or get handle from connection pool using function DBConnectionPoolAcquireConnection - this is the preferred method. Connections acquired from pool must be released with call to DBConnectionPoolReleaseConnection. Most of DB functions is straightforward. Two common patterns of usage are following:
1. Non-SELECT query: use DBQuery(handle, query); Function will return TRUE on success.
2. SELECT query: use DBSelect(handle, query); Function will return result set or NULL on failure. Then you can use DBGetNumRows(set) to get number of rows, DBGetValue(set, row, column, buffer, bufsize) (or any variations, like DBGetColumnLong) to retrieve data from set. When you finish, you must destroy result set by calling DBFreeResult(set);
In fact, there are audit log inside the server, it's just not accessible from management console. You can use server's function WriteAuditLog to add records to it.
Windows console is deprecated - I plan that 1.0.9 will be the last version with Windows management console as primary management tool. In 1.1.x branch, we are migrating to new cross-platform Java console. It is based on Eclipse, so it can be extended with plugins very easily. It's half-working already, and I hope to implement all functionality of legacy Windows console soon.
Best regards,
Victor