Skip to Content
0
Aug 02, 2012 at 09:38 PM

JDBC lookup Using UDF - error class java.math.BigDecimal:null incompatible with class java.lang.String:null

143 Views

Hi experts,

I have requirement to write a query on a Oracle table using a UDF.

This query can return multiple records.

However i get an error "class java.math.BigDecimal:null incompatible with class java.lang.String:null"

I am able to execute the same query using SQL Developer tool without any issues.

here is the code that i use:

//dfrunid is an array of strings (Input)

String Query = " ";

Channel channel = null;

DataBaseAccessor accessor = null;

DataBaseResult resultSet = null;

MappingTrace trace = container.getTrace();

// Query to retrieve the PROP value for the particular source value passed.

Query ="Select DFO_ID from mn_df_object where DFO_ID_PARENT="+dfrunid[0];

try{

//Determine a channel, as created in the Configuration

channel = LookupService.getChannel("<Business Service>","<Channel Name>");

//Get a system accessor for the channel. As the call is being made to an DB, an DatabaseAccessor is obtained.

accessor = LookupService.getDataBaseAccessor(channel);

//Execute Query and get the values in resultset

resultSet = accessor.execute(Query);

for(Iterator rows = resultSet.getRows();rows.hasNext();){

Map rowMap = (Map)rows.next();

result.addValue((String)rowMap.get("DFO_ID"));

}

}

catch(Exception ex){

result.addValue(ex.getMessage());

}

finally{

try{

if (accessor!=null) accessor.close();

}

catch(Exception e){

result.addValue(e.getMessage());

trace.addInfo(e.getMessage());

}}

Best Regards,

Ravikanth Talagana