cancel
Showing results for 
Search instead for 
Did you mean: 

Connection using type 4 driver

Former Member
0 Kudos

Hi,

We are using type 4 driver to connect to Oracle.

I am getting an exception as

"com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of CWD".

Can anyone tell me the reason and how to solve it?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Post your code. Your context lookup is failing. You have to make sure you have used the correct path and name.

Regards,

Subramanian V.

Message was edited by:

Subramanian Venkateswaran

Former Member
0 Kudos

This s my code:-

try

{

InitialContext ic = new InitialContext();

DataSource ds = (DataSource)ic.lookup("jdbc/CWD");

con=ds.getConnection();

st = con.prepareStatement("select desig from Users where username like cusername and cpassword like password");

rs = st.executeQuery();

String desig=null;

while(rs.next())

{

desig=rs.getString("desig");

if(desig.equals("admin"))

{

wdThis.wdFirePlugToadminview();

}

else if(desig.equals("customer"))

{

wdThis.wdFirePlugTouserview();

}

else

{

wdComponentAPI.getMessageManager().reportSuccess("Invalid Username/Password");

}

}

}

catch(Exception e)

{wdComponentAPI.getMessageManager().reportException(e.toString(),true);}

finally

{

try

{

rs.close();

st.close();

con.close();

}

catch(Exception e)

{

}

}

can u pls tel me wht is the problem?

Former Member
0 Kudos

Hi Indu,

"CWD" should a datasource created in visualadmin->services>jdbc->Datasource.

Please check this datasource exists or not in JDBC services.

Regards, Anilkumar

Former Member
0 Kudos

Hi

First you test in the J2EE Visual administrator the alias name is success in connetion with the database. You can check it in the DB Initialization Tab with the simple query.

If the connection not sucess try with vendor SQL

Kind Regards

Mukesh

Former Member
0 Kudos

IPrivateViewClaim.IClaimDetailElement element =wdContext.createClaimDetailElement();

try{

Context ctx = new InitialContext();

DataSource ds = (DataSource)ctx.lookup("jdbc/WebServiceDB");

Connection con=ds.getConnection();

Statement st=con.createStatement();

PreparedStatement pSt=con.prepareStatement( "insert into EmployeeClaim values(employeeNo)");

} catch (Exception e)

{

wdComponentAPI.getMessageManager().reportWarning(e.toString());

}