Skip to Content
author's profile photo Former Member
Former Member

having problems connecting to a SQL DB

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2005 at 08:04 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Marc,

      Thank for trying to help but I knew it is not the right way.

      anyhow it will be great if you'll help me find a simple example of building EJB for that perpose.

      and thank once again,

      Yoav

  • author's profile photo Former Member
    Former Member
    Posted on Jan 19, 2005 at 07:33 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.