How to connect webdynpro application to database (Sql server)

Hi Experts,
Can someone suggest me how to connect webdynpro application to SQL Server. (Possibly in detail)
Thanks Regards,
Sandeep

hi sandeep,
here is a sample code which connects to a backend database Oracle; Connection is same for all DBs as you are using open sql commands.
<b>   try {
     String eposta = wdContext.currentContextElement().getEposta();
     String tel = wdContext.currentContextElement().getTelefon();
     String company = wdContext.currentContextElement().getCompany();
     String message = " ";
     String onerikonusu = " ";
     String oneri_mdurum = " ";
     String oneri_odurum = " ";
     String oneri_bfaydalar = " ";
     String oncelik1 = " ";
     String uygulama = " ";
     String tarih = (new SimpleDateFormat("dd-MM-yyyy").format(new java.util.Date()));
     String saat = (new SimpleDateFormat("HH:mm:ss").format(new java.util.Date()));
     //java.sql.Date tarih = java.sql.Date.valueOf(creationDate);
     //java.sql.Time saat = java.sql.Time.valueOf(creationTime);
     if (wdContext.currentContextElement().getMesaj() != "")
        { message = wdContext.currentContextElement().getMesaj(); }
     if (wdContext.currentContextElement().getOneri_konusu() != "")
          { onerikonusu = wdContext.currentContextElement().getOneri_konusu(); }
     if (wdContext.currentContextElement().getOneri_mdurum() != "")
          { oneri_mdurum = wdContext.currentContextElement().getOneri_mdurum(); }
     if (wdContext.currentContextElement().getOneri_konusu() != "")
          { oneri_odurum = wdContext.currentContextElement().getOneri_odurum(); }
     if (wdContext.currentContextElement().getBekfaydalar() != "")
          { oneri_bfaydalar = wdContext.currentContextElement().getBekfaydalar(); }
     if (wdContext.currentContextElement().getOncelik() != "NULL")
          { oncelik1 = onceliktxt.toUpperCase(); }     
     if (wdContext.currentContextElement().getUygulama() != "NULL")
          { uygulama = app.toUpperCase(); }
   InitialContext ctx = new InitialContext();
   javax.sql.DataSource ds =
   (javax.sql.DataSource) ctx.lookup("jdbc/SAPEPPDB");
   java.sql.Connection con = ds.getConnection();
   con.setAutoCommit(false);
   java.sql.Statement stmt = con.createStatement();
     String sql;
      int rows;
      sql = "insert into tmp_feedbacks " +
           "(puid, name, tel, email, company, konu, oncelik, uygulama, mesaj, onerikonusu," +
           "oneri_mdurum, oneri_odurum, oneri_bfaydalar,tarih,saat) " +
           "values ('" + username + "', " +
                     "'" + name + "'," +
                     "'" + tel + "'," +
                     "'" + eposta + "'," +
                     "'" + company + "'," +
                     "'" + konutxt.toUpperCase() + "'," +
                     "'" + oncelik1 + "'," +
                     "'" + uygulama + "'," +
                    "'" + message + "'," +
                    "'" + onerikonusu + "', " +
                    "'" + oneri_mdurum + "', " +
                    "'" + oneri_odurum + "', " +
                    "'" + oneri_bfaydalar + "', " +
                    "'" + tarih + "', " +
                    "'" + saat + "' " +
     stmt = con.createStatement();
     rows = stmt.executeUpdate(sql);
     con.commit();
     stmt.close();
   catch(Exception e){
        IWDMessageManager msgMgr =
                wdComponentAPI.getMessageManager();
   msgMgr.reportException(e.getMessage(),true);
   }</b>
The value <b>ctx.lookup("<jdbc_pool>");</b> depends on your system id.
if your system id is SID the the string has to be <b>jdbc/SAPSIDDB</b>
you can check it via visual admin >> server >> services >> jdbc con.

Similar Messages

  • Connecting an application to a sql server database

    I want to make a login for an application. I need to check the username and password from a sql server database. I'm really at a total loss here. Can anyone tell me how to write the part concerning the connection? Thanks

    Hi,
    Please find below the code to connect to Sql Server
    database.
    You need to have the sqlserver server driver jar
    files(msbase.jar,mssqlserver.jar,msutil.jar)
    in your classpath
    import java.sql.*;
    * Microsoft SQL Server JDBC test program
    public class Test {
    public static void main (String args[]) throws
    s Exception {
    // Get connection
    DriverManager.registerDriver(new
    com.microsoft.jdbc.sqlserver.SQLServerDriver());
    Connection connection =
    n = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://<Host>:1433",<"UID>","<PWD
    if (connection != null) {
    System.out.println();
    System.out.println("Successfully connected");
    }-AmolThank you but would you please tell all the part I need to connect and to execute any statement? I hope my words are clear because I'm in such a mess when it comes to anything related to database. Also, could you please tell me where do I get the sqlserver jar files? Thank you.

  • How to connect a PDF form to SQL server database through web service?

    Hi,
    I'm new to LiveCycle designer. I have designed a PDF form in LC designer ES2, which suppose to take a personnel number and retrieve the personnel information from a SQL server database. Currently its working fine with XML data and a search button, but I need to securly connect to a database through web service. I know how to connect to a wsdl file through designer. What I need is a wsdl file to connect the form to database. For this purpose, is there any WSDL code to use as the web service?
    I really appreciate your help and advice.

    Hi,
    I'm new to LiveCycle designer. I have designed a PDF form in LC designer ES2, which suppose to take a personnel number and retrieve the personnel information from a SQL server database. Currently its working fine with XML data and a search button, but I need to securly connect to a database through web service. I know how to connect to a wsdl file through designer. What I need is a wsdl file to connect the form to database. For this purpose, is there any WSDL code to use as the web service?
    I really appreciate your help and advice.

  • How to connect Java Application with database!

    Dear all, now I am create a dababase application. My database use JData Store. But I don't know how to connect application with it. Can you tell me this proplem?
    Thank!

    Do a google search for JDBC, or go buy a book.
    You will need a JDBC driver which supports your database. Or you might be able to use the JDBC-ODBC bridge if there's an ODBC driver for your database.

  • How to connect from Oracle 11g to SQL Server 2008 R2

    Hi,
    Is it possible to connect from Oracle 11g on AIX to SQL Server 2008 R2? If so, what is the preferred method?
    SQL Server has the original table. From Oracle 11g, we want to access data which is in SQL Server real time.
    Thank You
    Sarayu

    Hi,
    Have a look at these Oracle notes for the full information on the gateways -
    Master Note for Oracle Gateway Products (Doc ID 1083703.1)
    Functional Differences Between DG4ODBC and Specific Database Gateways (Doc ID 252364.1)
    Gateway and Generic Connectivity Licensing Considerations (Doc ID 232482.1)
    How to Setup DG4MSQL (Oracle Database Gateway for MS SQL Server) 64bit Unix OS (Linux, Solaris, AIX,HP-UX) (Doc ID 562509.1)
    How to Configure DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX Itanium) to Connect to Non-Oracle Databases Post Install (Doc ID 561033.1)
    The Database Gateway for SQL*Server (DG4MSQL) needs a separate license but the Database Gateway for ODBC (DG4ODBC) is included in your RDBMS license. You only need to provide the third party ODBC driver needed by DG4ODBC.
    Regards,
    Mike

  • How to delete HFM Application Tables in SQL

    Hi Gurus
    1.How to delete HFM Application Tables in SQL?
    Manually its deleting but each application having 120-150 tables? how to do this in a single shot?
    I have deleted few applications using workspace/ shared services, but still its showing under HFM server under SQL Tables.
    Please help me
    regards
    Smilee

    Hi Smilee,
    1. If the application can be opened in Financial Management web interface, go to the Manage Taskflows module and make sure that no taskflows still exist for this application. Delete any existing taskflows.
    2. If the application exists in Shared Services, right click on the application in Shared Services and try to delete the application from there
    3. Stop Hyperion Shared Services and all Financial Management Windows processes and take backups of the relational database schemas of both.
    4. Check the relational database repository of Hyperion Shared Services, in the table "ces_apps" and make sure that there are no more rows containing the appname "EXAMPLE". If row still exists you should seek help from Oracle Global Software Support to clean up the Hyperion Shared Services before proceeding.
    5. It is possible to remove all content for a deleted application from the Financial Management relational database. Extreme care should be taken when manually manipulating database tables as permanent damage can be done to the intended application and other applications if the wrong content is deleted.
    a) Begin by deleting all tables, indexes, sequences and package objects that begin with the application name
    b) Delete any tables beginning HSV_appname_xxxxxx
    c) Delete any rows from the HSX_CLUSTER_xxxxx tables referring to the application.
    d) Delete any rows from the HSV_ACTIVITY_KILL_USERS, HSV_ACTIVITY_NO_ACCESS, HSV_ACTIVITY_SESSIONS and HSV_ACTIVITY_USERS and HSV_USERS_ON_SYSTEM that refer to the application name.
    d) Delete the row containing name of the application from the HSX_DATASOURCES table.
    6. The next time all the Hyperion services are started again, the application should be safely removed from Windows client.
    You can contact your DBA to write a query on how to delete it.
    Hope this helps,
    Thank you,
    Charles Babu J

  • How can I connect NetBeans 6.1 with SQL Server 2005?

    Hello guys...
    how can i connect NetBeans 6.1 with SQL Server 2005?
    there is no SQL Server in Server list when we create a new Web Project and choose Server.
    I'm new to NetBeans and this is my first time of posting.
    If has some errors and unwanted disturbing,pls understand me. Thanks.
    (If you have references or some snippets, i'll be glad if u can share.)
    scsfdev

    The JDBC-ODBC bridge wasn't recognizing any of the primary keys I had set up in SQL Server. After lots of head banging, here's the solution I came up with:
    1. Download the appropriate driver. SQL Server 2000 requires the SQL Server 2000 JDBC driver (http://www.microsoft.com/downloads/details.aspx?FamilyId=07287B11-0502-461A-B138-2AA54BFDC03A&displaylang=en).
    SQL Server 2005 download: (http://www.microsoft.com/downloads/details.aspx?familyid=C47053EB-3B64-4794-950D-81E1EC91C1BA&displaylang=en)
    3. After installing, right-click on "Libraries" in your project, and choose "Add Library...". Next, give it a name (i.e. SQLServer2000), and select "Class Libraries".
    4. On the next screen, find the JAR files (should be in C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\), and add them under the "Classpath" tab. It will now be available under "Libraries" for future projects.
    5. You can now create a connection to a specific database under the "Services" tab (next to "Projects" and "Files" in the top left of the screen). Select "Microsoft Sql Server 2000 (Microsoft Driver)" and format the "Database URL" like this:
    jdbc:microsoft:sqlserver//YOURSERVER:1433;DatabaseName=YOURDATABASE
    1433 is the default port, though your DBA may have changed it.
    I posted a simpler version of this on the NetBeans.org FAQ page - they had the following title with no content on the answer page:
    "Cannot Select Tables From MsSql 2000 Because It Says No Primary Key Next To Each Table But The Tables DO Have A Primary Key. What Do I Do?"

  • Inserting data to a . SDF database (SQL Server Compact Edition connection)

    Hi, all.
    I'm working on a project that worked fine while connecting to SQL Server 2008. I used a connection string like this:
    Driver={SQL Server Native Client 10.0};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
    Now, I've replaced all database connections in my project to work with SQL Server Compact Edition, and my connection string is something like this:
    Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=myDir\myDataBase.sdf; 
    After changing the type of connection, I'm getting an error on "DB Tools Insert Data.vi". This is what I get:
    Error -2147217872 occurred at NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlib: DB Tools Insert Data.vi->Main.vi
    Possible reason(s):ADO Error: 0x80040E30 Exception occured in Microsoft SQL Server Compact OLE DB Provider: The given type name was unrecognized. [,,,,,] in NI_Database_API.lvlib:Rec Create - Command.vi->NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlib: DB Tools Insert Data.vi->Main.vi
    This is a simplified block diagram (as I said, it worked perfectly while using SQL Server 2008 connection):
    Could you please help me?
    Thanks in advance,
    Francisco

    Hi, Steve. Thanks for your answers.
    I worked around this problem by using directly a SQL query instead of this function (you were right, using DBTools Execute Query VI). But now I'm getting problems with other functions, when inserting data into the DB including NULL values.
    I make a SQL query like this using DBTools Execute Query VI:
    INSERT INTO Table1 (Column1, Column2, Column3, Column4, Column5, Column6) VALUES ('Value1', 'Value2', 'Value3', 'NULL', 'Value5', 'Value6') 
    and get the following error:
    ADO Error: 0x80040E07Exception occured in Microsoft SQL Server Compact OLE DB Provider: A literal value in the command could not be converted to the correct type due to a reason other than data overflow. [,,,,,] in NI_Database_API.lvlib:Conn Execute.vi->INSERT (new) restricción (DBCT).vi->Restricciones a Base de Datos (DBCT).vi->Definir - editar restricciones.vi->Main.vi
    The same SQL query worked perfectly when using the SQL Server 2008 connection, so it's not a database structure issue.
    Could somebody please help me?
    Regards,
    Francisco

  • How to connect to a remote database in a lan??

    Hey guys......! I need to connect to a remote msaccess database in a lan and import its data into my mysql database.I know how to connect to a msaccess database using ODBC.But I don't know how to connect to a remote database without creating dsn in the machine where database is.One thing more...I want to know, how can I import data into my mysql database?? Is there any query for that or simply I have to select data from msaccess database and insert into tables of my database??Please, send me the source code in the forum itself and explain also.This is the last feature of my project.So I need to do it as soon as possible.

    If the mdb file in LAN, Just map the network drive.[Windows Explorer/Tools/Map Network Drive] in your system from which we need to access the remote mdb. Then go to ODBC Data Source Admin.. and create a new data source[Microsoft Access Driver] . After clicking the Select button, you will find a Network Drive will be visible on your Drives drop down. Select the map Drive, If not visible then just click the Network button there and map the network path where the mdb files reside. And use the JdbdOdbcDriver class to connect from java.

  • How to connect Java to oracle Database Express Edition?

    Anyone can help me?
    How to connect JAVA TO ORACLE DATABASE EXPRESS EDITION?

    I suggest you to read this article:
    http://wiki.oracle.com/page/JDBC
    Regards,
    Ricky

  • How To connect More Then One database

    How To Connect More the One Database In Single form.
    I want to use Access And Oracle In the Same Form.
    I want to Transfer data from Access file To oracle database.
    Chirag

    Hi,
    You can do this using EXEC_SQL package. Please see Note 115540.1 on metalink which describes how you can connect to Ms Access and Oracle using EXEC_SQL.
    Regards
    Kavitha Prakash
    Oracle Support

  • How to call procedure in Java from SQL Server Database

    Hello Every Body
    i Have Question about
    How to call procedure in Java from SQL Server Database
    Thanks

    Hi,
    have you tried a Google search? I just gave it a 3 second try and already found: http://stackoverflow.com/questions/6113674/how-do-i-execute-a-ms-sql-server-stored-procedure-in-java-jsp-returning-table-d
    Frank

  • How ignore Change_tracking in build script deployment in Project Database SQL Server VS2013

    Hello,
    I have a "Project Database SQL Server" in SSDT VS2013 and my scenario is as follows:
    My project database has not enabled the feature of [CHANGE_TRACKING].
    I have N production databases, and there are a few in particular that are characteristic of [CHANGE_TRACKING]
    enabled.
    When I publish the project database against a target
    base has not enabled the feature of [CHANGE_TRACKING] no problem, everything works as expected.
    The problem is when I publish
    the project database against a database that has ENABLED feature tracking changes.
    I want the VS to make the comparison
    of schemes in the publication, ignore this feature, and NOT generate deployment scripts with instructions like:
    'Alter table dbo.table DISABLE CHANGE_TRACKING'
    'Alter database name SET CHANGE_TRACKING = OFF'
    It is possible to somehow customize the build-deployment to avoid this outcome?
    I hope the collaboration of you lot.
    Thank you very much.
    Estyfen

    Hi, thanks by response.
    The configuration "Do not
    alter Change Data Capture objects"
    is on, but even so, I do not get
    the expected results. When I run the generated
    script publication makes me a "Disable
    CHANGE_TRACKING" tables that have
    activated the "track changes"
    in the destination database.
    Stay tuned for
    your help ..
    thank you very much
    Estyfen

  • Log the local variables (string type) to the database (SQL Server)

    i have a customized PreUUT callback so that my own VI gets the information from barcode. it contains serial number as well as other information. i am collecting the information into local variables of the PreUUT callback.
    Now i want to log the local variables (string type) to the database (SQL Server).
    i have a successful connection to the database and i am using a generic recordset schema.
    can anyone help me how to do it?
    also shall i have to create the corrosponding fields (columns) in the database? or is there any option in TestStand4.0 to do it?

    Hello i like original,
    After re-reading your original message, I think I might have a better understanding of what you would like to do.  I have included a few links to Knowledge Base and Developer Zone articles that should be very useful for you.  I have included these links below:
    Logging a New UUT Property to a Database in TestStand
    Logging a New Step Property to a Database in TestStand
    Creating a TestStand Database Schema from Scratch
    Thanks,
    Jonathan C
    Staff Application Engineering Specialist | CTD | CLA
    National Instruments

  • Connect Oracle Forms 6i with Sql server

    Plz tell how to connect oracle Developer 6i with Microsoft Sql Server 2005.
    thanks

    Ghulam Yassen wrote:
    Plz tell how to connect oracle Developer 6i with Microsoft Sql Server 2005.
    thanksOracle Forms is best used against an Oracle database... so why on Earth would you want to use it against SQL Server?
    Aside from that, Oracle Forms is old technology... you'd be better using Oracle Application Express (Apex) for producing web based apps.
    If you must do things against an SQL Server database, you would need to set up heterogenous services connectivity (HS) and treat the SQL Server database as an external database.
    http://docs.oracle.com/cd/E11882_01/server.112/e25494/ds_concepts001.htm#ADMIN12079

Maybe you are looking for

  • How to set up ipad for elderly user

    I want some ideas for setting up an iPad for my 89 year old father who has never used a computer and has some visual impairment. The only thing he wants to do is listen to audiobooks. I want the titles of the books to be no more than one click away f

  • Guidance on the structuring of Projects in OWB

    Dear all i am after some guidance / best practice for the use of projects within OWB and how best to structure to gain the best benifit within the warehouse environment. We have decided to apply a staging area becuase we pull data from around eight s

  • Mic adaptor for touch 3G?

    sorry if this has been dealt with before, i did do a search, but it didn't turn up the answer. i have a nice stereo mic with a minijack connector and i'm wondering if there's an adaptor i can buy for my 3g touch, so i can use it with voice memo etc.

  • Calling functions / setting variables in loaded SWF

    You know how you can create a Movieclip object, add a function or variable to it, then call that function or change that variable from within the SWF that includes it? I wanna be able to do that, only with SWFs that are loaded at run time. My "main"

  • Will Lightroom 3.2 support the Tethering of a Nikon D7000 camera or of a Nikon D3100 camera?

    I am thinking about buying one of Nikon's new camera.  will lightroom 3 support the tethering of a Nikon D7000 or a Nikon D3100 camera? Thanks, Jim Koeper