working variant without hibernate + jdbc