Ejemplo n.º 1
0
 public Connection getConnection() {
   try {
     if (connection == null || connection.isClosed()) {
       loadJdbcDriver();
       connection =
           DriverManager.getConnection(
               GeneratorProperties.getRequiredProperty("jdbc.url"),
               GeneratorProperties.getRequiredProperty("jdbc.username"),
               GeneratorProperties.getProperty("jdbc.password"));
     }
     return connection;
   } catch (SQLException e) {
     throw new RuntimeException(e);
   }
 }