on 07-02-2008 1:37 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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());
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
In the exception instead of using:
catch(Exception ex){
result.addValue(ex.getMessage());
}
try using
catch(Exception ex){
result.addValue(ex.getCause());
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.