Oracle or MS SQL Server, EJB Models and Web Dynpro Application

Hi
I've a table in MS SQL database. I've created in Visual Admin, the datasource(jdbc/MyAlias) for the above. SQL Server has Employee Table with EmpId, FirstName, LastName and Description as its Columns.
I want to display, modify , insert and delete entries from the Employee Table using web Dynpro. For this we have used JDBC method by which we create class file which will have JDBC connectivity and logic for getting data from backend. This class file then used for display, update and other operations. And the context is built at design time.
This is not proper method, as this doesn't come under perview of MVC concept.
I want to use EJB Models for this case. But I'm stuck with some problems.
1. How do I implement EJB models in this scenario.
2. How do EJB module (entity bean) connects to external database.
3. What are the most logical steps to be used in this case.
Any pointers for this will greatly appreciated with points?
So far I was able to do create EJB module of Entity Bean type with all interfaces. But beyond this I'm not able to proceed. Do let me know the step wise procedure for this kind of scenario.
Thanks
Srikant

Hi Srikant,
I have worked on similar stuff, but the scenario was a little different. I worked on creating Web Services using EJBs, but the basic part was that, the web service was supposed to interact with the SQL Server database. So maybe I can help you...
First thing which is needed is that you have created the JDBC Connector in your Visual Administrator correctly. If you wish to cross check, you can see my answer in the following thread:
JDBC error
In this thread itself I have given the code which is the solution to your problem (this is what i believe). I am pasting the code again:
<b>InitialContext initialContext = new InitialContext();
DataSource dataSource = (DataSource)initialContext.lookup("jdbc/MyAlias");
java.sql.Connection connection = dataSource.getConnection();</b>
You can use this code in the method of your EJB, and then you can easily use this connection object to access your database tables using SQL queries.
And if by any chance you are looking for a step wise procedure for creating a web service from an EJB, then give me your email address, i will send you the doc.
Bye
Ankur
Do reward points if it helps!!

Similar Messages

  • Error while importing EJB model in Web dynpro: Unable to fetch the EJBs.

    Hi,
    We are getting the below error while importing ejb model to Web dynpro.
    Error :
    Unable to fetch the EJBs. Check if the selected Enterprise Application contain the EJBs.
    I have created the public part-> It has a reference to EJB client and the enterprise application also has reference to the EJB project.The EJB is also added in dependency list.
    But still we are getting this error. Could anyone please explain what can i do to solve this issue.
    Best Regards,
    Karthika

    Hi Vishweshwara,
    Thanks for your reply.
    Please find the steps i followed while importing EJB model in webdynpro.
    1. The Entity forwarding permission has been enabled.
    2. public part reference has been created and through the reference entity option the ejbDC->Client public part is selected.
    I followed all the steps mentioned in the document. But still i am getting that error. In EJB DC we have list of JPA entities and stateless session beans are exposed as a webservice(top-down manner).The enterprise application has a reference to the EJB DC.
    I could be able to invoke the ejb service beans from ejb explorer and Webservice navigator.
    I am able to insert,delete and modify the records from there.
    Please let me know what could i do to resolve this error?
    Best Regards,
    Karthika
    Edited by: SAKarthika on Apr 29, 2011 1:43 PM

  • How to import EJB components and Web Dynpro into WAS 6.4

    I have EJB components and developed Web Dynpro application.
    Is it possible to upload directly without using NWDS? My system is very slow while running NWDS.
    I don't know how to upload or deploy those on WAS 6.4.
    Can any one help me out on this.
    Thanks,
    Mahesh

    Hi,
    The default SDM password is <b>sdm</b>, try this one.
    1. Once login into SDM select <b>Deployment</b> tab.
    2. Click the first Icon to add your .EAR files.
    3. Continue the deployment process by clicking the <b>Next</b> button.
    4. In last screen of the deployment <b>Confirm</b> the deployment.
    Let me know if you need anything.
    Thanks
    Srinivasu Rao Sandaka

  • Using EJB Model in Web Dynpro

    I have to redeploy my EJB.ear (used as a Web Dynpro model) everytime the J2EE server is started (only the first time), after which My Web Dynpro program continues to work. In other words, the following code in my Command Bean is not successful without redeploying the EJB.ear for some reason. Can someone please tell me what I am doing wrong ?
    home = (MyLocalHome) context.lookup("localejbs/MySessBean");

    Walter, thanks for the reply.  When I checked the EJB Container in VA after starting up the J2EE server, my EJB shows a blue check mark already with the START button grayed out (STOP button is active).  So I would think the EJB is started already...  HOWEVER, I noticed that when I hit the DEPLOY button there, I see a warning message popping up which says :  "This Application hasn't J2EE modules, so it cannot be loaded. Proceeding with Deploy".  I go ahead and finish the Deploy and then my EJB works.  It seems I am not including a module when I deploy it ?
    Paul

  • Use Some Models in Web Dynpro Application

    Hi,
    1. When creating a model we need to refer it to r/3 environment. what should we do if we transfer the application to another environment?
    2. I would like to have an application with 4 views that each one activates A DIFFERENT bapi/rfc function.
    Is It ok to create some models in same application ?
    Thanks in advance,
    Ronit

    Hi,
    please find below path for adding External Jar files.
    right click on the webdynpro dc and select the properties .
    then clcik on Java Build path->select libraries->select External External Jars.
    after that just rebuild your project (not Build).
    Regards,
    Govindu
    Edited by: Govindu Nagotla on Apr 12, 2011 2:28 PM

  • RFC Adaptive model in web dynpro application gives mandatory parameter erro

    Hi,
    I need to check  when we create model to call bapi from backend, are there any checks for the input data which are done by the model before  the bapi is called ?
    I am passing some input parameters and I get the following error on the screen. and the return structure is empty.
    Mandatory parameter BFLUSHDATAGEN of method BAPI_REPMANCONF_CREATE_MTS missing
    But if I pass the very same paramters directly in se37 transaction to the bapi, then this error is not seen. it gives some other error in return structure.
    There fore I have a doubt is there any check which doesnt call the bapi at all if it doesnt find the parameters it is looking for. I know the paremeters are not correct but I expect to see the same error what is seen in se37 in the return structure of my modal context element.
    thanks in advance for help.
    r

    hi, I have  corrected my code and written the below code inthe controllers init method.
    Bapi_Repmanconf_Create_Mts_Input parent = new Bapi_Repmanconf_Create_Mts_Input();
    wdContext.nodeBapi_Repmanconf_Create_Mts_Input().bind(parent);
    Bapi_Rm_Datgen input1 = new Bapi_Rm_Datgen();
    wdContext.nodeBflushdatagen().bind(input1);
    input1.setMaterialnr("100-400");
    input1.setPdc_Number("100066");
    parent.setBflushdatagen(input1);
    Even this I getmandatory paramter missing eror
    kindly help
    Edited by: rita c on Nov 6, 2008 6:29 PM

  • Create and insert into table from Oracle to MS SQL server.

    Hello,
    Oracle Database 11g and Red hat 5
    I have a very different kind of issue. I am handling the ORACLE db(remote db with all the important data). On the other side their is a MS SQL server db(local db with some testing data in it). All the users will access the ORACLE db for the actual processing but for sometime they need to apply some of their own concepts. So they will transfer the data from ORACLE to MS sql server.
    I want to create a code in ORACLE db like a procedure , which will create a table in MS sql server , insert data into it,Also create some metadata table to keep some of my table's info on MS SQL serve db,If the table is present it should append the data, .... like many things ...
    Overall my question is , how can i write a code to make these operation on a remote db, that to these operations are DDL and on MS SQL Server(Non-Oracle) ???
    Please guide me with some ideas or solutions ...
    Also provide if you have some good links to study ...
    thanks in advance.

    I'm not sure why you never visit http://tahiti.oracle.com prior to asking any question. Is it forbidden in your locale? Are you afraid of it? Will your salary be decreased when you visit the documentation?
    http://www.oracle.com/pls/db111/search?word=sql+server&partno=
    should provide sufficient information.
    Your doc question must be considered a violation of Forum Etiquette and an abuse of this forum.
    Sybrand Bakker
    Senior Oracle DBA

  • Insert data into oracle based on sql server data(here sql server acting as source to oracle and destination to oracle)

    Source is Oralce. Destination is SQL Server.
    Requirement - I have to fetch sql server server data (empid's) based emp table  and send this as input data to oracle to fetch and empid's are common.
    I cannot use merge or loopkup or for each as oracle have too many records.
    For example - In MS SQL - i have empid=1,2..Only these records, I have to fetch from oracle source into sql server destination. For this, I have adopted the below approaches...The major problem I face, when i build a empid's as a string, it is taking only
    4000 chars. My string lenght is 10000. How do I breakup this string lengh and send to data flow task till all broken strings length passed to DFT.
    Approach-1
    created two variables - oraquery string, empid string
    step1 - ms sql database - created sql task - declare @empid varchar(max)
    SELECT @empid=
    Stuff((SELECT ',' + empid
            FROM  
            (SELECT  DISTINCT  convert(varchar(10),empid ) empid FROM emp
             ) x
            For XML PATH ('')),1,1,'')
    select @empid =    '(' +  @empid + ')'
    select @empid
    resultset=singlerow
    resultset=resultname=0; variablename=User::empid (empid is declared as string)
    step2 - oracle database - created data flow task
    created oledb source
    I put  this statemnt in oraquery expression - "select * from dept where dept in  "
    +  @[User::empid] + "
    expression=true
    [OLE DB Source [1]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E14.
    An OLE DB record is available.  Source: "Microsoft OLE DB Provider for Oracle"  Hresult: 0x80040E14  Description: "ORA-00936: missing expression".
    Approach-2
    created three variables - oraquery string, empid  int, loop object--when I put int then it is automatically setting to 0
    step1 - ms sql database - created sql task - SELECT  DISTINCT  convert(varchar(10),empid ) empid FROM emp
    resultset=fullresult
    resultset=resultname=0; variablename=User::loop
    step2 - created a for each loop container
    for loop editor - for each ado ennumerator
    enumerator configuration - loop
    variablemapping - variable=empid;index=0
    step3 - oracle database - created data flow task (outside for each loop. If I put inside it is taking long time)
    created oledb source
    I put  this statemnt in oraquery expression - "select * from dept where dept in  "
    +  @[User::empid] + "
    expression=true
    Data inserting in a destination table but  empid=0.

    Sorry didnt understand if your step3 is outside loop how
    @[User::empid] will get values for the empids from User::loop. The iteration happens inside loop so you
    need to have a logic to form the delimited list inside using a script task or something and concatenating everything and storing to variable @[User::empid]
    . Then only it will have full value used to be used in step3 query
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Issue while importing table from oracle to sql server using import and export wizard

    Hi All,
    I am trying to populate oracle table to sql server using import export wizard  and i am getting the below error.the table is allready present in the database but still it throwing error like table doesn't exists.
    Could not connect source component.
    Error 0xc0202009: Source - JOB_ACTION_HISTORY [1]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    Error 0xc02020e8: Source - JOB_ACTION_HISTORY [1]: Opening a rowset for ""FLXUSER"."JOB_ACTION_HISTORY"" failed. Check that the object exists in the database.
     (SQL Server Import and Export Wizard)
    Kindly help me out
    Thanks in advance

    Hi Snehasis,
    Please check whether the table name in the Oracle database has lower case letters. The table name should be exactly correct. 
    In addition, the issue might be related to the Oracle driver. What provider/driver do you use? If you use Microsoft OLE DB Provider for Oracle, you can try the
    Oracle OLE DB Provider. If you use Enterprise or Developer edition of SSIS 2008 or higher, you can also try the
    Microsoft Connectors for Oracle by Attunity. The  Oracle OLE DB Provider and Microsoft Connectors for Oracle are proved to have better performance.
    Regards,
    Mike Yin
    TechNet Community Support

  • Maintaining the structure of a SQL Server staging area and dwh aligned with the Oracle data source

    Hi,
    I'm working in a context where the data source system, in Oracle, is a continuos work in progress. Each 1-2-3 weeks the data source system in the prod environment is updated with new tables or updated table (with new columns or altered columns). So, it is
    important to apply in a rapid manner the related changes in the data structure of the SQL Server staging area and dwh.
    The issues to solve are:
    a. maintaining SQL Server data structure of the staging area aligned with the data structure of the Oracle data source;
    b. maintaing SQL Server data structure of the staging area aligned with the data structure of the SQL Server staging area.
    In order to solve these issues it could be useful to think to an authomatic manner to alert when a data structure change occurs and a simple manner to apply the changes on SQL Server data structure.
    Any suggests, please? Many thanks

    We use Oracle CDC service in SQLServer. It has a flag to indicate the schema changes happening at the Oracle end. We track the schema changes using it and then apply changes to sqlserver side. And regarding automation you can use Biml as suggested or .NET
    scripts inside script task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

    I'm trying to migrate a Sql Server 2k database to an Oracle 8i schema using OMWB. After using BCP to collect metadata information on the source database, I tried to capture the source data model and got a "Capture aborted" message on the progress screen (even though then it appears a dialog window reporting "0 errors and 0 warnings", funny!). Down there is the error log OMWB generated. After reading some posts, I changed some columns of the OMWB dictionary that holds the source database name, but still got the same error. If someone can enlighten me on this toppic, I'd greatly appreciated it.
    Here's the error log of OMWB:
    ** Oracle Migration Workbench
    ** Production
    ** ( Build 20050629 )
    ** OMWB_HOME: D:\Datos\Download\Oracle\Oracle Migration Workbench\omwb
    ** user language: es
    ** user region: null
    ** user timezone:
    ** file encoding: Cp1252
    ** java version: 1.4.2_04
    ** java vendor: Sun Microsystems Inc.
    ** o.s. arch: x86
    ** o.s. name: Windows 2000
    ** o.s. version: 5.0
    ** Classpath:
    ..\lib\boot.jar
    ** Started : Fri Feb 23 17:18:48 GMT-03:00 2007
    ** Workbench Repository : Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    Repository Connection URL: jdbc:oracle:thin:@ServerCms:1521:sigcewbc
    ** The following plugins are installed:
    ** Microsoft Access 2.0/95/97/2000/2002/2003 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 2000 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 6.5 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 7.0 Plugin, Production Release 10.1.0.4.0
    ** Active Plugin : SQLServer2K
    EXCEPTION :SQLServer2KDisconnSourceModelLoad.loadSourceModel(): oracle.mtg.migration.MigrationStopException: java.lang.IndexOutOfBoundsException: Index: 15, Size: 15
    ** Shutdown : Fri Feb 23 18:00:50 GMT-03:00 2007

    Duplicate thread
    Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

  • Unable to configure Oracle Publisher in SQL SERVER 2008 R2

    Hi, All,
    I am trying to talk to my Oracle database from SQL server. I already had Oracle Client 11g installed in my SQL server. 
    Following the guidance in the technet on configuring the Distributer successfully. I now trying to configure the Publisher, by choosing "Adding Oracle Publisher" option. Then it prompt for the user id & password, I have enter the login (which
    is replication user id created in Oracle). I encounter following error msg:
    TITLE: Distributor Properties
    Oracle server instance 'ssluat' cannot be enabled as a Publisher because of the following error:
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1&EvtSrc=Microsoft.SqlServer.Management.UI.ConfigureWizardErrorSR&EvtID=OraclePublisherValidateFailed&LinkId=20476
    Quote:
    ADDITIONAL INFORMATION:
    Unable to run SQL*PLUS. Make certain that a current version of the Oracle client code is installed at the distributor. For addition information, see SQL Server Error 21617 in Troubleshooting Oracle Publishers in SQL Server Books Online. (Microsoft SQL Server,
    Error: 21617)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=21617&LinkId=20476
    Unquote
    In fact  I can run SQL*PLus from my c:\drive command prompt and the Path in Envinronment variable has set to "c:\app\product\11.2.0\client_1\bin". So I don't know why thing msg prompt?
    I have search the guideline on this error in Technet and do what I can to troubleshoot but still got error.
    Kindly pls help me.
    Thank you.
    Avelyn

    1.Make certain that a current version of the oracle client code is installed at the distributor”, please install corresponding version of Oracle
    Client tools on Distributor Box
    2.Are you able to connect to your Oracle server from the Distributor Box?if so,Distributor
    box needs to have Oracle client tools installed on it before you can setup replication , I hope you have installed the Oracle client tools on Distributor Box. If yes, check if using SQLPlus you can connect manually to Oracle server or not from your Distributor
    Box.
    Moreover,Please refer the below
    Before attempting to configure the Oracle Publisher, SQL Server verifies that SQL*PLUS is accessible through the system path on the Distributor. If SQL*PLUS cannot be loaded, the following error message is shown:
    "Unable to run SQL*PLUS. Make certain that a current version of the Oracle client code is installed at the distributor."
    Try to locate SQL*PLUS on the Distributor. For an Oracle 10g client install, the name of this executable is sqlplus.exe. It is typically installed in %ORACLE_HOME%/bin. To verify that the path of SQL*PLUS appears in the system path, examine the value of the
    system variable Path:
    Right-click My Computer, and then click Properties.
    Click the Advanced tab, and then click Environment variables.
    In the Environment Variables dialog box, in the System variables list, select the Path variable,
    and then click Edit.
    In the Edit System Variable dialog box: if the path to the folder that contains sqlplus.exe is not present in the Variable
    value text box, edit the string to include it.
    Click OK on each open dialog box to exit and save changes.

  • What is the easiest way to export all tables data from Oracle to MS SQL Server?

    Hello MS,
    I would like to export all tables from Oracle 11.2 to MS SQL Server 2012 R1.
    Using the tool "Microsoft SQL Server Migration Assistant v6.0 for Oracle" did not work for me because there are too many warnings and errors regarding the schema creation (MS cannot know it because they are not the schema designer). My idea is
    to leave/skip the schema creation to the application designer/supplier and instead concentrate on the Oracle data export and MS SQL data import.
    What is the easiest way to export all tables data from Oracle to MS SQL Server quickly?
    Is it:
    - the „MS SQL Import and Export Data“ Tool
    - the “MS SQL Integration Services” Tool
    - not Oracle dump *.dmp format because it is a propritery binary format
    - flat file *.csv (delimited format)
    Thanks!

    Hi lingodingo,
    If you want to directly export all tables from Oracle database to SQL Server, I suggest you use SQL Server Import and Export Wizard. Because you just need to follow the wizard with GUI, this is the easiest way.
    If you want to make some modification for the tables‘ data before loading to SQL Server, I suggest you use SQL Server Integration Services package. For more details, please refer to the following similar thread:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/38b2bed2-9d4e-48d4-a33f-1d9eed1c062d/flat-file-to-sql-server?forum=sqldatamining
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Taking snapshot of oracle tables to sql server using transactional replication is taking a long time

    Hi All,
    I am trying to replicate around 200 oracle tables onto sql server using transaction replication and it taking a long time i.e the initial snapshot is taking more than 24 hrs and it still going on.
    Is there any way to replicate those these tables faster?
    Kindly help me out..
    Thanks

    Hi,
    According to the description, I know the replication is working fine. But it is very slow. 
    1. Check the CPU usage on Oracle publisher and SQL Server. This issue may due to slow client processing (Oracle performance) or Network performance issues.
    2. Based on SQL Server 2008 Books Online ‘Performance Tuning for Oracle Publishers’ (http://msdn.microsoft.com/en-us/library/ms151179(SQL.100).aspx). You can enable the transaction
    job set and follow the instructions based on
    http://msdn.microsoft.com/en-us/library/ms147884(v=sql.100).aspx.
    2. You can enable replication agent logging to check the replication behavior. You may follow these steps to collect them:
    To enable Distribution Agent verbose logging. Please follow these steps:
    a. Open SQL Server Agent on the distribution server.
    b. Under Jobs folder, find out the Distribution Agent.
    c. Right click the job and choose Properties.
    d. Select Steps tap, it should be like this:
    e. Click Run agent and click Edit button, add following scripts by the end of scripts in the command box:
            -Output C:\Temp\OUTPUTFILE.txt -Outputverboselevel 2
    f. Exit the dialogs
     For more information about the steps, please refer to:
    http://support.microsoft.com/kb/312292
    Hope the information helps.
    Tracy Cai
    TechNet Community Support

  • Replication of table from Oracle 10g to sql server 2000

    Could i replicate table from Oracle 10g to sql server online. we have tables with same configuration and if any change happen in oracle 10g or sql server in that table we need to replicate that change to other database.
    What is the solution for this two way replication between sql server and Oracle 10g

    But the tutorial is saying that i will have to install Oracle database on the server already having sql server, is it client or whole database, if it is then it will acquire lot of resource.
    I want to find out that for Heterogenous Service ODBC, we need third party software for ODBC Driver of SQL SERVER for Linux and secondly if we use Transparent Gateway then what are the steps for its configuration.
    I could not find steps of configuration of Transoparent gateway, when i am trying to install Transparent gateway from Universal installer, it is not there. where do i find it , Do i need to purchase it too.

Maybe you are looking for