on 01-17-2005 8:22 AM
Hi all,
I'm using webdynpro and i need to connect to a db.
the line below throghs the Exception ClassNotFoundException.
Class.forName("com.sap.dbtech.jdbc.DriverSapDB");
I have imported thre jar sapDB.jar what else can i do?
I want to connect to an sql DB via java and i stack.
need your help,
Yoav
Hi Yoav,
I belive you put the database access codes in your Web Dynpro's implementation. In this case you need to have your JDBC driver deployed as shared library to the server. You also need to define the Library Reference in your Web Dynpro's project properties.
However, this is not a good approach and Web Dynpro never intends for business process development. You should have an EJB wrapped your database access. Then import this EJB as a model in Web Dynpro to preserve the MVC separation. Always remember Web Dynpro is an UI development tool and not for business process.
Regards,
Marc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another approach would be to use the container (SAP J2EE Engine's) datasources. You can configure datasources via the Visual Administrator tool of the SAP J2EE Engine (or use an Alias on the existing WebAS database). Than lookup this DataSource from the JNDI context.
Regards
Bruno
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yoav check out this link
http://help.sap.com/saphelp_nw04/helpdata/en/7d/26e96f1d754408bfd658b6614cb1b6/frameset.htm
Basically you would then use something like
DataSource ds = (DataSource) context.lookup("java:comp/env/jdbc/MyAlias")
if I recall correctly
Thanks
Bruno
Hi Yoav,
just in addition to the hints Bruno gave look at this https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/working with database tables in open sql for java.pdf especially pages 17-27 (and around).
If one likes SQLJ / OpenSQL is a matter of taste and working brain but anyhow, the steps to access / reference a datasource are now standardized within NWDS, that's at least an approvement compared to the old 6.20 way. On the other hand, creating DataSources (if you don't want to use the default DataSource) stays within VisualAdmin, you can access infos about this from Brunos link given (Managing Aliases -- Creating a Datasource...).
Hope it helps
Detlev
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.