on 08-12-2008 11:37 AM
hi
i am making an application using Access Database using the following code
*try {*
*Connection conn=null;*
*Statement s=null;*
*ResultSet rs=null;*
** **
** **
** **
*Context ctx=new InitialContext();*
*DataSource ds=(DataSource)ctx.lookup("jdbc/AccessDb");*
** conn = ds.getConnection();**
** s = conn.createStatement();**
*rs = s.executeQuery("select empname from stable");*
** IPrivateApplic1View.IRsElement elm=null;**
** while (rs.next())**
** {**
** elm=wdContext.nodeRs().createRsElement();**
** elm.setValue(rs.getString(1));**
** wdContext.nodeRs().addElement(elm);**
** }**
** } catch (Exception e) {**
** **
** wdComponentAPI.getMessageManager().reportSuccess(""+e);**
** e.printStackTrace();**
** }**
but it is showing the error
*com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of AccessDb.*
Hi,
To use Access DB in Webdynpro you have to create a Data source in Visual Administrator under JDBC Connector option.
Then You can use the Data source Alias Defined for Access DB in Visual Admin for LookUp like This:
ctx.lookup(jdbc/<DS Alias Name")
Regards,
Siddharth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must give a right Data Source name for the connection. You will find the same using Visual Administrator->Services->JDBC.
Specify the name at the code to get back-end access.
Regards
Vinod V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you are trying to connect Access Db via DSN, try to check created DSN is correct or not, check the name case of DSN is same or not coz DSN name is case sensitive.
From the error discription it seems failing at the look-up time. Plz check the DSN created in the Visaul Admin and try to run simple query,coz you need to create DSN in the Visaul Admin.
Regards,
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi viswas iyer ,
Check out the Database and database connection object.
Thanks
Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
where you have created DSN....???, in local machine or in the Sever using/via Visaul Admin.
Coz from Web Dynpro you need to create DSN in the Visaul Admin then it will work for you. In that you need to define all DSN related information. Then from your application you need to use created DSN name.
Regards,
Deepak
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.