Can anybody please guide me how to change the JNDI of a rpt file from jsp.

I am passing the username and password from jsp using
ConnectionInfos connInfos = new ConnectionInfos();
IConnectionInfo connInfo1 = new ConnectionInfo();

But I donot know how to send the JNDI. If the database SID is changed then I need to create a new report file . How can I use the existing report file