Hi,
    I am new to Visual age for java Environment.I am trying to Test an EJB
which connects to Oracle database using datasource. For the above purpose I
have followed the steps as follows.

I created the EJB  and generated the  deployed classes. I started the
persistent name server and added a datasource to it with the name "Test".
The parameters I mentioned are as follows.

DataSource Name = Test
Database Driver = Oracle.jdbc.Driver.jdbcDriver
Database URL = jdbc:oracle:thin:@<hostName>:<portNumber>:<databaseName>

With these parameters I was able to add the Datasource successfully.


In the EJB Proprties, I mentioned the JNDI Name for BeanHome as "Chitta"

In the EJB Server Properties  I mentioned the DataSource Name as "Test" and
Connection type as "Oracle.jdbc.driver.OracleDriver".

With all above set I started the Persistent Name Server and EJB Server and
tried to test the EJB With the Test Client   .  When I  invoked the business
method in debugging mode ,I am getting  NameNotFoundException, while it is
looking up for the Datasource in the Initial Context factory.

In My Bean Implementation class I am accessing the DataSource in the
following way.

------------------------


    java.util.Properties p = new java.util.Properties();


p.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextF
actory");
    p.put(javax.naming.Context.PROVIDER_URL, "iiop://<Host>:<portnumber>");


    InitialContext ic = new InitialContext(p);

    DataSource ds =(DataSource)ic.lookup("Test");


---------------------
Is there anything wrong with it ?? Can anyone help me in this regard ???

Regards
Chitta

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to