using sql instead of jdbc