Skip to Content

DB Lookup Not Initialising PLz Help!

Dear all,

I Tried to do DB Lookup as told in this blog by siva

/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

I used the below code.

I am not Getting any error, the mapping is successfully ACTIVATED. But in the Receiver field i am Getting Null as output , the DB lookup which i have mentioned is not connecting to the Database and executing and fetching the query. Just in the receiver field its througing the Null valuse(Default Initialisation Values). The Required Value is not fetched by using the communication channel.

I am getting the above error when i try to TEST THE MAPPING in IR.

Below is the code i used.

SERVER:XI 3.0

SP:18

RECEIVER DATABSE: MSQL SERVER 2000

-


CODE----


-

*//write your code here

String Query = "";

Channel channel = null;

DataBaseAccessor accessor = null;

DataBaseResult resultSet = null;

Query = "Select cir_id from circle where cir_sap = 'IDBL'";

try{

channel = LookupService.getChannel("<Business Service/System Name>","JDBC_channel_receiver Communication channel");

accessor = LookupService.getDataBaseAccessor(channel);

resultSet = accessor.execute(Query);

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

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

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

}

}

catch(Exception ex){

result.addValue(ex.getMessage());

}

finally{

try{

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

}

catch(Exception ex){

result.addValue(ex.getMessage());

}

}*

-


END CODE----


Please help me out.

I am getting output as null. But in database value is there for cir_id where cir_sap='IDBL'.

Regards,

Prakash

Edited by: senthilprakash selvaraj on Jul 2, 2008 2:37 AM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 02, 2008 at 03:10 AM

    hi

    your 'JDBC_channel_receiver Communication channel' won't be active/latest changes made to the channel won't be updated in the cache. Check the cache notifications.

    Also see whether the expected results are returned with the normal java JDBC coding(connecting without using channel).

    rgds

    Arun

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 02, 2008 at 04:47 AM

    In the exception instead of using:

    catch(Exception ex){

    result.addValue(ex.getMessage());

    }

    try using

    catch(Exception ex){

    result.addValue(ex.getCause());

    }

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 02, 2008 at 05:21 AM

    Hi Senthil,

    I think i know what the problem is. Please modify your code slightly and let us know whether it is working now.

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

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

    result.addValue((rowMap.get("cir_id")).toString());

    }

    Add comment
    10|10000 characters needed characters exceeded

    • Dear Varun,

      Thanks a Million Times.actually to openly say. U R ANSWER only HELPED And My querry worked.

      But Varun by mistake i gave the total points the other person, i thought that it was u.! in a hurry i gave the points to the other person yaar ! Please dont mistake me. and i am not in a position to revert it .

      Please dont mistake me both of you. And thans a ZILLION times for all who tried to help me really it means something for me.

      Regards,

      Prakash