public void setDataSourceName ( String dataSourceName ) { if ( initialized ) { throw new IllegalStateException ( "Cannot set Data Source properties after DataSource has been used" ) ; } if ( this . dataSourceName != null && dataSourceName != null && dataSourceName . equals ( this . dataSourceName ) ) { return ; } PGPoolingDataSource previous = dataSources . putIfAbsent ( dataSourceName , this ) ; if ( previous != null ) { throw new IllegalArgumentException ( "DataSource with name '" + dataSourceName + "' already exists!" ) ; } if ( this . dataSourceName != null ) { dataSources . remove ( this . dataSourceName ) ; } this . dataSourceName = dataSourceName ; }
Sets the name of this DataSource . This is required and uniquely identifies the DataSource . You cannot create or use more than one DataSource in the same VM with the same name .