You can see this thread page for a starting point on fetching data from a DB and this thread for a further discussion.

In order to feed LS Server with updates from a DB table, you can ask the DB for notifications; otherwise, the simplest way is to inquiry the table at regular intervals (but your code has no wait in the loop, which may be infeasible).
By the way, you close the connection to the DB inside the "while" loop, which compromises the loop behavior.

I confirm that you have to code the client and Data Adapter in parallel, because the item and field names involved have to be the same.
On the other hand, in the first phase, you can stick to the same Metadata Adapter used by the provided samples.