The enrolled fingerprint data can be found in Enroller.Template. Then use MemoryStream to to save and serialize the said fingerprint data. then pass the memorystream to your byte in order to upload it to your longblob column in your database.
Here's My example code in c# format:
private void featureS()
this.Invoke(new Function(delegate ()
MemoryStream fingerprintData = new MemoryStream();
byted = fingerprintData.ToArray();
I hope this gives you an idea. But before you save the fingerprint template, you must first verify if it already exist in the database.