-
1. Re: Very Urgent !!!!!Regarding DataSource access through EJB
vickyk May 24, 2002 8:23 AM (in response to vickyk)Hi,
Sorry for not giving the files but I tried it gave the
problem,let me try again..It is not comming up...Any way
let me put the additional method here alongwith the default one.....
***************************
/**
Calulates the compound interest on the sum `principle', with interest rate per
period `rate' over `periods' time periods. This method also prints a message to
standard output; this is picked up by the EJB server and logged. In this way we
can demonstrate that the method is actually being executed on the server,
rather than the client.
*/
public double calculateCompoundInterest(double principle,
double rate, double periods)
{
System.out.println("Someone called `calculateCompoundInterest!'");
return principle * Math.pow(1+rate, periods) - principle;
}
/** Gets the reference of DataSource.Implemented by vk 24/05/2002
*/
public DataSource getDataSource(String sname)
{
DataSource ods=null;
try
{
InitialContext initial = new InitialContext();
ods=(DataSource)initial.lookup(sname);
}
catch(Exception e)
{
System.out.println("Error in getDataSource "+e);
}
return ods;
}
********************************
Hope this to be clear for the understanding
regards vickyk -
2. Re: Very Urgent !!!!!Regarding DataSource access through EJB
davidjencks May 24, 2002 3:04 PM (in response to vickyk)Buy the docs or read the code.
Pay attention to what the datasource is bound under, java:/DefaultDS != DefaultDS -
3. Re: Very Urgent !!!!!Regarding DataSource access through EJB
vickyk May 27, 2002 2:51 AM (in response to vickyk)Hi,
I have checked the consle lots of times and it shows
the DataSource bound as java:/DefaultDS,Now source I have
am downloading and it will take a time to understand the
object hirerchy and relationship.As my requirement
is very urgent I would be thankful if some contributes
regarding reading the default DS from the EJB...
Thanks a lot..
regards vickyk