cancel
Showing results for 
Search instead for 
Did you mean: 

How to: webdynpro java - EJB - MS SQL

Former Member
0 Kudos

Hi there,

I have to create a Java webdynpro application which reads data from MS SQL and show the data on the screen.

I'm also required to create a model based on EJB, because I need to use EJB's as a layer between the DB and my application.. Can someone tell me how to proceed?

Does someone have a tutorial concerning this?

Inputfields on the screen:

u2022 Store

u2022 ProductType

u2022 Depot

u2022 DeliveryDT

Thanks

Kind regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi there,

Thanks, but these links don't have anything to do with the topic..

Kind regards

Allan

Former Member
Former Member
0 Kudos

Thanks Ayyapparaj.

I've created 2 java classes:

1) class Book with attributes Title & Author


/*
 * Created on Jun 10, 2007
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package javabeans;

/**
 * @author AllanDu
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class Boek {

	public String titel;
	public String auteur;
	
	public Boek(){
		titel = "titel_"+Math.random()*100;
		auteur = "auteur_"+Math.random()*100;
	}
	
	public String getAuteur(){
		return auteur;
	}
	
	public String getTitel(){
		return titel;	
	}
	
	public void setAuteur(String sauteur){
		auteur = sauteur;
	}
	
	public void setTitel(String stitel){
		titel = stitel;
	}
}

2) Class DemoJavaBeanDao in which a collection of these Books will be kept. This collection should then be filled in the execute method.


/*
 * Created on Jun 10, 2007
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package javabeans;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @author AllanDu
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class Demo_javabean_dao {
	
	public Collection Boeken = new ArrayList();

}

One thing I just cannot understand is how to do the relations between the javabeans & why. Could someone help me out with this?

Answers (2)

Answers (2)

Former Member
0 Kudos

This message was moderated.

ankur_garg5
Active Contributor
0 Kudos

Hi Allan,

Here also try going through this document:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/b00917dc-ead4...

The link was not working earlier when I replied to your other thread. Check now.

You can create the EJB which talks to the MS SQL server. Then you can use this EJB as a Model in your Web Dynpro (as is explained in the document provided by Ayyapparaj in his reply above)

Bye

Ankur

Former Member
0 Kudos

Hi Ankur,

Thanks )

Check other thread please.

Kind regards

Allan