on 06-28-2006 5:14 AM
as title as said.thanks in advance.
additional: web dynpro project deployed in ep6.
Hi,
1) In your WD add reference to "dbppol" service (right click on WD project->properties->web dynpro references->service references)
2) add <NWDS>\eclipse\plugins\com.sap.tc.ap\comp\SAP-JEE\DCs\sap.com\dbpool\_comp\gen\default\public\default\lib\java\dbpool.jar to class path of your WD project
3) put something like
InitialContext context = new InitialContext();
final DataSourceManager dsm = (DataSourceManager)context.lookup("dbpool");
final Hashtable dataSources = dsm.getDataSources();
final Set entries = dataSources.entrySet();
for (Iterator iter = entries.iterator(); iter.hasNext();) {
final Map.Entry entry = (Map.Entry) iter.next();
final JDBCDescriptor desciptor = (JDBCDescriptor)entry.getValue();
wdComponentAPI.getMessageManager().reportSuccess( desciptor.getDataSourceName() + ":" +
desciptor.getDBConnectInfo() + ":" +
desciptor.getDriverClassName() + ":" +
desciptor.getDriverName() + ":" +
desciptor.getInfo());
}
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,Maksim Rashchynski
thanks for your reply!
but i still met some wrong executed as u said.as following:
1) In your WD add reference to "dbppol" service (right click on WD project->properties->web dynpro references->service references).
<b>=====i opened that directory,and click add button,created a reference named "<u>dbpool</u>",not "<u>sap.com/dbpool</u>",is right?</b>.
2) add <NWDS>\eclipse\plugins\com.sap.tc.ap\comp\SAP-JEE\DCs\sap.com\dbpool\_comp\gen\default\public\default\lib\java\dbpool.jar to class path of your WD project.
<b> =====so pity i cann't find that .jar file.but i can search it under the directory of "usr\sap\J2E\JC00\j2ee\cluster\server0\bin\services\dbpool",so i copy it to the directory of lib of my webdynpro project.and add it to "right click on WD project->properties->java build class->libraries".</b>
step 3 i did as u said.
but a little errors appeared in my web dynpro 'implementation:<u>this compilation unit indirectly references the missing type com.sap.engine.frame.state.managementInterface(typical some required files is referencing a type out the classpath)</u>.
Hi,
What is your WAS version?
I have WAS 6.40 SP14 and service name is just "dbpool".
In case of sneak preview jar is located at C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.sap.tc.ap_2.0.0\comp\SAP-JEE\DCs\sap.com\dbpool\_comp\gen\default\public\default\lib\java\dbpool.jar
Best regards, Maksim Rashchynski.
Hi,
Try to add "NWDS\JDT\eclipse\plugins\com.sap.tc.ap\comp\SAP-JEE\DCs\sap.com\com.sap.engine.deploy.online\_comp\gen\default\public\default\lib\java\sapj2eenginedeploy.jar" to class path too.
BTW, you don`t need to copy jars to lib folder! In this case jar will be included to WD ear and deployed to WAS. But jar`s are already there and you can face class loading issues (most probably).
Best regards, Maksim Rashchynski.
hi,Maksim Rashchynski:
thanks for u post!
the problem as above is solved as the way of u said.
but web dynpro code cann't excuted correctly.i debug it step by step.
...
<b>final JDBCDescriptor desciptor = (JDBCDescriptor) entry.getValue();</b>
=========cann't go on here.
Looking forward to u reply .
thanks!!
hi,Maksim Rashchynski
error as following:
InitialContext context = new InitialContext();
final DataSourceManager dsm = (DataSourceManager)context.lookup("dbpool");
final Hashtable dataSources = dsm.getDataSources();
final Set entries = dataSources.entrySet();
for (Iterator iter = entries.iterator(); iter.hasNext();) {
final Map.Entry entry = (Map.Entry) iter.next();
<u><b>final JDBCDescriptor desciptor = (JDBCDescriptor)entry.getValue();</b></u>
<i>//before everything looked well.debug here step by step ,cann't go on,i don't know what's happened.</i>
......
and: can u tell me how to get the API of DataSourceManager and JDBCDescriptor object.
thanks a lot!
Hi,
Sorry, my fault. it should be as :
InitialContext context = new InitialContext();
final DataSourceManager dsm = (DataSourceManager)context.lookup("dbpool");
final Hashtable dataSources = dsm.getDataSources();
final Hashtable aliases = dsm.getAliases();
final Hashtable drivers = dsm.getDrivers();
final Set entries = dataSources.entrySet();
for (Iterator iter = entries.iterator(); iter.hasNext();) {
final Map.Entry entry = (Map.Entry) iter.next();
final Vector desciptors = (Vector)entry.getValue();
for (Iterator iterator = desciptors.iterator();iterator.hasNext();) {
final JDBCDescriptor desciptor = (JDBCDescriptor) iterator.next();
wdComponentAPI.getMessageManager().reportSuccess( desciptor.getDataSourceName() + ":" +
desciptor.getDBConnectInfo() + ":" +
desciptor.getDriverClassName() + ":" +
desciptor.getDriverName() + ":" +
desciptor.getInfo()
);
}
}
Best regards, Maksim Rashchynski.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.