By default hive use two Metastores first one meta store service, and second the database called by default metastore_db and it uses derby. so i think you have to install and configure derby with hive.
But i have not seen the use of hive in your code.
I hope my answer help you