on 08-13-2008 7:00 AM
hi,
if i am using backend ms access file in webdynpro java.if some error has come in running time
""com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of myname""**The my code part is
InitialContext ctx;
try {
ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup( "jdbc/myname");
Connection con = ds.getConnection();
String SelectStmt = "select name from Table1" ;
PreparedStatement stmt = con.prepareStatement(SelectStmt);
ResultSet resultSet = stmt.executeQuery();
while (resultSet.next())
{
IWDNodeElement element = wdContext.nodeNode().createElement();
element.setAttributeValue("name", resultSet.getString("name"));
wdContext.nodeNode().addElement(element);
}
}catch (Exception e) {
// TODO: handle exception
wdComponentAPI.getMessageManager().reportSuccess("ahdsjfahdsj " + e);
}
so send me correct solution
Hi Patrick,
You have to specify a correct data source name, You can find it in Visual Administrator-> services->JDBC->Data Source Name..
In lookup method, specify as
DataSource ds = (DataSource)new InitialContext().lookup( "jdbc/<DSName>");
Regards
Vinod V
Edited by: Vinod V on Aug 13, 2008 11:54 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Patrick,
check for JNDI name ..
go to EjbProject->ejb-j2ee-engine.xml..double click on it
n chk whethr u hav givn the same jndi name or nt??
Regards,
Khushboo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can also do the following .
-- Create an Enterprise application project and right click on the project a context menu will come up.
Choose a option Data source Alias (Some thing like that)
give any name and build and deploy the EAR file.
Now in your webdynpro code you can LookUp the Alias like this ctx.lookup("jdbc/<DS Alias Name>")
Hope this will help.
Regards,
Siddharth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.