Reading Multiple Rows

lundi 29 décembre 2014

Im trying to filter a message received based off of a query. If the messages facility number matches any of the numbers returned from the query then allow the message to go through. If it doesnt then stop the message. Below is my code that I have in the destination's filter.



var i = 1;

var dbConn = DatabaseConnectionFactory.createDatabaseConnection ('net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sql http://server"":1433;DatabaseName=""','mirth','mirth');

var result = dbConn.executeCachedQuery("SELECT FACILITY FROM INTERFACE_IP_ADDR WHERE INTERFACE = 'NAME'");

while(result.next())

{

var f = result.getString(i);

if($('msg_rcv_fac') == f)

{

return true;

}

else

{

exit;

}

i++;

}





Reading Multiple Rows

0 commentaires:

Enregistrer un commentaire