Java Code Examples for org.springframework.jca.cci.CannotCreateRecordException

Following code examples demonstrate how to use org.springframework.jca.cci.CannotCreateRecordExceptionfrom spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.jca.cci.CannotCreateRecordExceptionand various code implementation of this class.

	public IndexedRecord createIndexedRecord(String name) throws DataAccessException {
		try {
			RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory());
			return recordFactory.createIndexedRecord(name);
		}
		catch (NotSupportedException ex) {
			throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex);
		}
		catch (ResourceException ex) {
			throw new CannotCreateRecordException("Creation of indexed Record failed", ex);
		}
	} 


	public MappedRecord createMappedRecord(String name) throws DataAccessException {
		try {
			RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory());
			return recordFactory.createMappedRecord(name);
		}
		catch (NotSupportedException ex) {
			throw new RecordTypeNotSupportedException("Creation of mapped Record not supported by connector", ex);
		}
		catch (ResourceException ex) {
			throw new CannotCreateRecordException("Creation of mapped Record failed", ex);
		}
	} 

	protected Record createRecord(RecordCreator recordCreator) throws DataAccessException {
		try {
			RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory());
			return recordCreator.createRecord(recordFactory);
		}
		catch (NotSupportedException ex) {
			throw new RecordTypeNotSupportedException(
					"Creation of the desired Record type not supported by connector", ex);
		}
		catch (ResourceException ex) {
			throw new CannotCreateRecordException("Creation of the desired Record failed", ex);
		}
	} 

   }

   public void createAssetChart(AssetClass[] assetdata, WebUtil util) throws CannotCreateRecordException
   {
      Map<String, String> configMap = util.getWebprofile().getWebInfo();
      if (assetdata != null)
      {
         if (configMap.get("CHART.ASSET.ALLOCATION") != null &&
            configMap.get("CHART.ASSET.ALLOCATION").equalsIgnoreCase("HIGHCHART.2DDONUT"))
         {
            chartData = (highChart.create2DDONUTChart(new ArrayList<Asset>(assetdata[0].getAssetclass().values())));
         }
         else {
            primefacechart.createPieModel(assetdata, 0);
            chartData = getPieChart();
         }
      }
   } 

Advertisement
Javadoc
Exception thrown when the creating of a CCI Record failed for connector-internal reasons. @author Ju

ergen Hoeller @since 1.2

Read More
Advertisement