title: Where should I create a local db, and connect-disconnect from a database?
body: <p>in a college project I have a Java application,</p>
  
  <p>the main method do some stuff, then call a method that every 10 seconds:<br>
  -connects to a local database, (localhost, username and password are known), <br>
  -do some stuff with data from the tables<br>
  -then disconnect.<br></p>
  
  <p>My questions are: <br>
  1- is it a bad idea connect and disconnect to the database everytime that this method runs? should I connect and disconnect in the main method and pass as an arguments the database handler?? <br></p>
  
  <p>2- this projects runs in my pc becouse I have MySQL process (I'm using Xampp) running and becouse I know database name and table name. If i want this project be able to run everywhere (without making the other people create a database with same name and table in their local mysql) should I create the db or tables from my project? is that possible?<br></p>
  
  <p>Thank you!!</p>