I've written this MySQL database class for my Java application and I'd just like some feedback on it before moving onto making my next class.The idea here is that I have a simple properties file which stores the hostname, username, password, and database name. I then connect to the database (if possible) and return the Connection.Although I am not really sure what should happen if the properties file doesn't exist, or the MySQL connection fails, should I return Connection which would be null, throw a new exception, or re-throw the existing exception?package app;import java.io.IOException;import java.io.InputStream;import java.sql.Connection;import java.sql.DriverManager;import java.sql.SQLException;import java.util.Properties;public class Database {    private String hostname;    private String database;    private String username;    private String password;    private Connection conn;    public Connection getConnection() {        if(conn == null) {            try {                System.out.println(Getting properties file...);                Properties prop = new Properties();                InputStream input = Database.class.getResourceAsStream(database.properties);                prop.load(input);                this.hostname = prop.getProperty(hostname);                this.database = prop.getProperty(database);                this.username = prop.getProperty(username);                this.password = prop.getProperty(password);                input.close();            } catch (IOException ex) {                // Error Reading Properties File                ex.printStackTrace();            } finally {                if (this.database != null) {                    try {                        System.out.println(Connecting to database...);                        Class.forName(com.mysql.jdbc.Driver);                        conn = DriverManager.getConnection(jdbc:mysql:// + this.hostname + / + this.database + ?user= + this.username + &password= + this.password);                    } catch (SQLException ex) {                        // Error Connecting to Database                        ex.printStackTrace();                    } catch (ClassNotFoundException ex) {                        // Error Connecting to Database                        ex.printStackTrace();                    }                }            }        }        return conn;      }}
Returning a database connection
java