title: JDBC connection pooling advice
body: <p>I am developing an application in java for processing data and uploading it to a MySQL database. With this application, I iterate through all of the files that need processed in a directory. With each row of the file, I store the data from that row into a variety of variables and do some transformations to get all of the data ready for uploading to my database. Then I plan to upload that row's data to the database with a PreparedStatement and INSERT query.</p>
  
  <p>I am unfamiliar with the best practices for my situation. I'm in the process of teaching this to myself so I'm looking for a little guidance to make sure I do it correctly the first time.</p>
  
  <p>Would it be inappropriate simply to open a connection at the beginning of the application's runtime (ie. open it once)? For each insert query I would create and close the PreparedStatement, but I would simply leave the connection open until I finished processing all of the files. </p>
  
  <p>I've read about connection pools elsewhere but I can't figure out if it is applicable in my situation. I know its expensive to open and close connections frequently, but shouldn't I be able to just open it once and run all of my queries under that connection?</p>
  
  <p>If you would recommend using a connection pool, what service would you recommend for my situation. Preferably it will be easy to get a handle on quickly. My project is somewhat time sensitive. Thanks.</p>