title: How do I read a properties file and connect a MySQL database?
body: <p>I need to connect my MySQL database from within Java program, for that I have to use JDBC.</p>
  
  <p>I need to supply it with the necessary connection parameters. And I have to store these parameters in a separate configuration file to be passed as an argument to your Java program during execution. A sample <code>db.properties</code> file has been provided to me for my reference. The five lines of the file correspond to the host, port, database name, username and password for the database. I need to change the parameters according to your individual system setup.</p>
  
  <p>How do I proceed with this? How do I connect MySQL database?</p>
  
  <p>basically, I have a createdb.sql file . I have to run that file in mysql. It will create a database. Now I need to populate the database. I have two input files. I need to write a program in java that takes the names of the input data files as command line parameters, parses the files, and populates the data contained within them into your database via JDBC</p>