Hi all,

Strange things abrew. I have my Interbase datasource set up as list below. I
thought the way inside of an EJB to find a DataSource would be:

Context context = null;

try
{
  context = new InitialContext();
  interbase.interclient.DataSource ds = (interbase.interclient.Datasource)
context.lookup("java:comp/env/jdbc/myEJBDS");
}
catch(NamingException ne)
{
}


However, through various trial and errors, I found the only way I can get it
is if I do:

Object o = context.lookup("jdbc/myEJBDS");

If I try to typecast it to an interclient datasource, I get a class cast
exception. I am at a loss as to why if this is J2EE standard programming, I
have to be database specific or vendor specific at any point, and why is it
not finding it in java:comp/env?

Thanks for any help.



<data-source class="com.evermind.sql.ConnectionDataSource"
                  inactivity-timeout="120"
                  location="jdbc/SelectScreenDS"
                  name="My Data-source"
                  xa-location="jdbc/xa/MyXADS"
                  ejb-location="jdbc/MyEJBDS"
                  url="jdbc:interbase://localhost/c:/database/mydb"
                  connection-driver="interbase.interclient.Driver"
                  username="sysdba"
                  password="masterkey"
                  />


Reply via email to