Furnishings of the church, thus 3 altars and sculptures, including the sculpture of David in question, were created in 1766 on the initiative of the then parish priest Andrzej Dominik Lipiewicz. David is a figure in the Old Testament. He was a King of Judah, a zither player and an author of Psalms. In iconography, he is portrayed in royal attire, very often with a harp as an attribute, as in the sculpture in question.
Paulina Kluz, "David", [in:] "The Sacred Lesser Poland Heritage", 2023, source: https://sdm.upjp2.edu.pl/en/works/david