code: public Connection getConnection() throws SQLException {
  
          if (_connection == null) {
  
              _connectionDataSource = _context.getControlPropertySet(ConnectionDataSource.class);
              _connectionDriver = _context.getControlPropertySet(ConnectionDriver.class);
              final ConnectionOptions connectionOptions = _context.getControlPropertySet(ConnectionOptions.class);
  
              if (_connectionDataSource != null && _connectionDataSource.jndiName() != null) {
                  _connection = getConnectionFromDataSource(_connectionDataSource.jndiName(),
                                                            _connectionDataSource.jndiContextFactory());
  
              } else if (_connectionDriver != null && _connectionDriver.databaseDriverClass() != null) {
                  _connection = getConnectionFromDriverManager(_connectionDriver.databaseDriverClass(),
                                                               _connectionDriver.databaseURL(),
                                                               _connectionDriver.userName(),
                                                               _connectionDriver.password(),
                                                               _connectionDriver.properties());
              } else {
                  throw new ControlException("no @\'" + ConnectionDataSource.class.getName()
                                             + "\' or \'" + ConnectionDriver.class.getName() + "\' property found.");
              }
  
              //
              // set any specifed connection options
              //
              if (connectionOptions != null) {
  
                  if (_connection.isReadOnly() != connectionOptions.readOnly()) {
                      _connection.setReadOnly(connectionOptions.readOnly());
                  }
  
                  DatabaseMetaData dbMetadata = _connection.getMetaData();
  
                  final HoldabilityType holdability = connectionOptions.resultSetHoldability();
                  if (holdability != HoldabilityType.DRIVER_DEFAULT) {
                      if (dbMetadata.supportsResultSetHoldability(holdability.getHoldability())) {
                          _connection.setHoldability(holdability.getHoldability());
                      } else {
                          throw new ControlException("Database does not support ResultSet holdability type: "
                                                     + holdability.toString());
                      }
                  }
  
                  setTypeMappers(connectionOptions.typeMappers());
              }
          }
  
          return _connection;
      }
docs: Returns a database connection to the server associated with the control.
  The connection type is specified by a ConnectionDataSource or ConnectionDriver annotation on the control class
  which extends this control.
  <p/>
  It is typically not necessary to call this method when using the control.