How create a jndi / datasource for MySQL?

Hi. This is CarloSilva, from Brazil, again. This time for help to datasource. My application uses MySQL database and ADF components. Please, would can anybody tell me step to step how to create a jndi conection datasource?
I need setup project for uses datasource, no jdbc connection. How to?
I need setup web.xml. How?
I need setup a datasource in JDeveloper for my application. How?
Please, sorry this questions but I new in JDeveloper and need use it for learn.
Thanks.

A JDBC connection may be used as a JNDI resource.
If the Connections-Navigator connection is DBConnection1, the corresponding datasource is jdbc/DBConnection1DS.
1. Create a JSP page.
2. In the web.xml of the JSP add
<resource-ref>
<res-ref-name>jdbc/DBConnection1DS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
3. In the JSP page obtain a connection with the datasource.
InitialContext initialContext = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)initialContext.lookup("java:comp/env/jdbc/DBConnection1DS");
java.sql.Connection conn = ds.getConnection();

Similar Messages

  • How to use JNDI datasource instead of database connection settings JDev 10g

    Hi,
    In order to use the different database from other environments, we are not able to use the JNDI datasource configuration settings, all the time need to configure the database connection settings from JDeveloper by changing the database connectivity settings in the JDeveloper for each environment separately, need a solution on how to make the database connectivity unique using the JNDI datasource name for all the environments for database connectivity settings through the application server console rather than changing the database adapter configuration in JDeveloper.
    Please provide the update at the earliest. Your help is greatly appreciated. Thanks in advance..

    What are you not clear on?
    What you need to do is get your developers to conform to a database naming standard, as stated above, so if you have an oracle database that is for eBusiness Suite you get all developers to create a DB connection in JDev called, ora_esb as an example.
    When the developer creates a DB adapter this will create a JNDI name of eis/DB/ora_ebs. When the BPEL project is deployed it looks for the JNDI name in the oc4j-ra.xml file to see its connection details. If they don't exist then they use the developers connection details. The issue with this is that they generally always point to the development DB. It is best practice for the developers to remove the mcf settings in the DB adapter WSDL. This way if the JNDI name has not been configured it will fail.
    So when you migrate from dev-test-prod what you have is the JNDI name eis/DB/ora_ebs. The dev points to the dev instance of ebs, test points to the test instance and so on. This means that you don't need to adjust any code in the BPEL projects.
    cheers
    James

  • How to setup JNDI Name for Oracle Apps adapter?

    Hello,
    I am learning Oracle SOA 11g and trying to do some tutorial on Oracle Application Adapter.  I know how to configure JNDI for DBadapter and I did that successfully. I followed same steps to create New JNDI for Oracle Apps Adapter.
    1. I Created new data source using Path Services->Data Sources -> New Genric Data Source. Connection to database was successful and created new JNDI Name: jdbc/PKDTAPPS.
    2. Then Deployment-> OracleApps Adapter-> Configuration-> Outbound Connection Pools -> New and created JNDI Name eis/Apps/PKDTAPPS.
    However I did not find newly created JNDI Name in step 2 under Deployment-> OracleApps Adapter-> Configuration-> Outbound Connection Pools -> javax.resource.cci.ConnectionFactory.
    Please let me know if am I following correct steps to create new Oracle Apps Adapter JNDI Name or not.
    Since above approch did not work I created new JNDI for DBAdapter with same database connection details. And then latter on use that JNDI Name while creating Oracle Application Adapter in JDeveloper composite. And it allowed me to access Oracel Apps open interface. However while deploying the application it gave me following error.
    <Feb 16, 2015 10:50:59 AM CST> <Error> <oracle.integration.platform.blocks.deploy.servlet> <SOA-21537> <Sending back error message: There was an error deploying the composite on AdminServer: [JCABinding]
    [adapter-Apps-101-JournalImport.InsertJournal/1.0]Unable to complete unload due to: Cannot locate Java class oracle.tip.adapter.apps.AppsTableWriteInteractionSpec: Cannot locate Java class
    oracle.tip.adapter.apps.AppsTableWriteInteractionSpec..>
    Since I have no past experience kindly suggest me what is right way to do this.
    Thanks,
    Shri

    Hi shri,
    Can you check the targets of oracle apps adapter that is it deployed on both cluster and admin server both.
    Deployment-> OracleApps Adapter-> Targets
    Regards,
    Anshul

  • Help needed on allocating a JNDI name for MYSQL on Glassfish

    Hi,
    I am trying to invoke my database (MYSQL) through a JNDI lookup on GlassFish Server. I copied the MySQL connector into the GLASSFISH_HOME/lib directory and went into Admin console (http://localhost:8080/login.jsf) to create a ConnectionPool. After this, I am not sure what I should do, inorder to associate a "jdbc/mysql" JNDI name for this pool. Can anybody point me to what has to be done?
    Thank you.

    Figured it. After you've setup your pool, you need to go to Resources -> JDBC -> JDBC Resources and then create an new mapping of the pool that you've just created to some name (ex: "java/mysql"); This should integrated Glassy with Mysql
    Thanks.

  • How to use jndi datasource on Weblogic instead of adding a DB data source

    Hi All,
    version: 11.1.1.4
    I am trying to figure out how in my ADF applications I can use an existing jndi datasource out on our weblogic servers instead of having to bury the Database db source in my adf applications. Like SOA I would like to reference the DB directly during design so I can pull in entities and build view objects, but when I deploy I want it to reference the jndi datasource out on the weblogic server.
    Is this possible? If so I am not sure how to configure it like I would a DB adapter in SOA.
    As always appreciate the info.
    Thanks,
    S

    If you use ADF in the model layer (application modules) you can configure them to use JNDI Datasources. Just right click on the application module and select 'Configurations...'. In the next dialog you see all the configurations currently available (one named xxxxxlocal and one named xxxxxshared at least). Select the local and hit the edit button. This open the DB connect dialog where you can change the connection from JDBC URL to JDBC Datasource (JNDI). Save your work and when you now start the app it will use the JNDI name.
    Timo

  • How to set class path for mysql

    hai, I have been trying to make a java program read from mysql database. but i don't know how to set the class path for mysql-connector-java-5_1_.0.6-bin. i set the class path in system variable as C:\Program Files\Java\jdk1.5.0_08\jre\lib\ext\mysql-connector-java-5_1_.0.6-bin.
    in the command prompt, i compile C:\javac abc.java and run java abc.
    when run it come out error java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    i am using Window xp. can anybody help me??? TQ.

    hai, I have been trying to make a java program read
    from mysql database. but i don't know how to set the
    class path for mysql-connector-java-5_1_.0.6-bin. i
    set the class path in system variable as C:\Program
    Files\Java\jdk1.5.0_08\jre\lib\ext\mysql-connector-jav
    a-5_1_.0.6-bin.
    in the command prompt, i compile C:\javac abc.java
    and run java abc.
    when run it come out error
    java.lang.ClassNotFoundException:
    com.mysql.jdbc.Driver
    i am using Window xp. can anybody help me??? TQ.Right click on my computer icon,
    Goto properties->advanced->environment variables.
    Look for 'classpath' under system variable.
    Select it and click edit.
    put ';' and path of the mysql connector jar at the end
    suppose if u have jar file under d:/driver/mysqlconnector.jar
    thn put this value in variable value text box
    ;d:/driver/mysqlconnector.jar
    or simply put ur driver jar file in jre/lib/ext folder
    D:\j2sdk1.4.2_03\jre\lib\ext
    [Servlet tutorial|http://www.jsptube.com]

  • How to find infosource/datasource for master data.....

    i would like to know how to find the infosource/datasource for the master data in RSA1, i have looked for in infosources options to find master data infosource, say for example 0material,  0fiscalyear /0fiscperiod. i was not able to find but in the process chains the data is getting loaded into it. i could see the data going from monitor screen to the selection screen of the master data and then click on execute button and data is present.
    secondly when i have clicked on the respective infoobject i was not able to find any requests under requests tab???????

    Hi
    go to RSA1 -> Infosources ->
    Here go to top screen ...or find the control icon thru cntl +F
    here enter your infosource/infoobject name......
    Double click on the result and it will show the infosource...under that infopackage
    Assign points if useful
    Regards
    N Ganesh

  • How create to master contracts for each new sold to party

    Hey SAP geeks,
    I have a scenario, in which I need to create a maitenance contract based on support items in a billing document. The system should create a master contract for a particular sold to party if that sold to party has ordered support for the first time.(system should first search whether any master contracts exist for this particualr sold to and then create one if there arent any already created.) After the master contract is automatically created ,the system should create maintenance contracts based upon the support items in the billing document and then assign this contract to the master contract for that particualr sold to party. Is this possible? Can you tell me how we can do this? Points will be awarded. I guess this requires lot of ABAP programming. but it would be great if some help is provided.
    Thanks.
    Naveen

    Dear Hanumant,
    As per my view,,
    You can use one time customer functionality to full fill your requirement.
    When you create sales order with one time customer system take you to the customer data maintanence screen through that you can maintain the one time customer data.
    Same one time customer number you can use for every new order through maintaining different data.
    I hope this will help you,
    Regards,
    Murali.
    Edited by: Murali Mohan.Tallapaneni on Dec 19, 2008 6:08 AM

  • How create a Component Usage for a BI Report

    Hi,
    I am new to CRM and I am trying to Display a BI Report Inside of a CRM WebClient UI, but I cannot find where to create a Component Usage for my BI Report. I have done the following steps:
    1. I defined my (BI) report in Customizing for Customer Relationship
    Management under UI Framework > UI Framework Definition > Display SAP NetWeaver BI
    Reports in CRM.
    2. I defined a logical link in Customizing for Customer Relationship Management under UI
    Framework > Technical Role Definition > Define Navigation Bar Profile.
    3. I know that the next step is to create a Component Usage for the BI Report in the runtime repository
    Editor. But I donu2019t know where to do this step, is their any Transaction Code for this?
    Thanks for any help

    Hi,
           Am I right in understanding that you want to make your BI report available as a link in a workcenter? If yes, then you have to make the logical links available per business role. You can get some hints from this WIKI.
    [https://wiki.sdn.sap.com/wiki/display/CRM/AddyourcustomBSPcomponentasalinkinaWork+Center]
    and this
    [https://wiki.sdn.sap.com/wiki/display/CRM/HowtoaddcustomBIReportsonReportsWorkcenterlinkinWEB+UI]
    Regards,
    Arun Prakash

  • How to find the Datasources for the given table names ?

    Hi All,
    I have an urgent requirement where I ned to find the names of BW Datasources, created for the given table names.
    Both the tables and Datasources are in BW system only. I can see the table in SE11 but I am unable to find its associated Datasources in the 'Where Used List'.
    Is there any method ?
    Will assign points to satisfactory answers.
    Regards,
    Srinivas

    Hi,
    Check this thread on how to find the DS.
    I have the field name, please help me find the data source.
    Once you identify your DS you find which all Data targets are fed by trying to see the " Show data flow" in RSA1 for this data source.
    Hope this helps.
    Thanks,
    JituK
    Edited by: Jitu Krishna on Apr 30, 2008 11:52 AM

  • HOW create support message ONLY for KEY USER

    Hi all,
    I just configured my service desk and I wanted to give only the key users the permission to create support messages. But every user have the rights to create a message from the satellite system.
    How can I prevent that? Is it possible to hide the option in the menu bar (help - create message) for non-key-users? The key users have the role SAP_SV_FDB_NOTIF_BC_CREATE . non sap users have just standard roles for hr, ...
    Thanks in advance!

    hi,
    in the documentation it is written
    Create messages from satellite systems with Help ® Create Support Message
    SAP_SOL_SERVTRANS_CREATE
    Authorization object S_RFC,
    profile S_RFC_VERS with the activity Execute for the object SAPSMO*
    this is working fine
    see link http://help.sap.com/saphelp_sm310/helpdata/en/71/50548566324a7491916585fe73a2b4/content.htm
    best regards Xavier

  • JNDI Datasource for MS SQL Config

    I'm at a lose as to how to configure and use the tomcat connection pool. Can anyone give me some pointers and help with this. I have read the forums and the help doc that comes with Tomcat but it didnt really help at all. What am i suppose to put into xml files in Tomcat and where are those xml files. How do i use this when its configured. I tried to get a look at some of the threads in the forum that might help me but i couldnt see them. Error thrown. I know i have to use this to access the connection pool.
    Context ctx = new InitialContext();
    if(ctx == null )
    throw new Exception("No Context");
    DataSource ds = DataSource)ctx.lookup("java:comp/env/jdbc/TestDB");
    if (ds != null) {
    Connection conn = ds.getConnection();
    Is it ok to use this in a class not a servlet?
    Thanks
    A troubled and confused man

    You have to configure these resources both in the <tomcat>/conf/server.xml file and in the web.xml file of your webapp.
    Your server.xml entry goes in &ltContext> or <Default-Context> and will look something like:
    <Resource name="jdbc/testDB" auth="Container" type="javax.sql.DataSource" description="Connection to fireguard database"></Resource>
    <ResourceParams name="jdbc/testDb">
    <parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
    <parameter><name>username</name><value>db</value></parameter>
         <parameter><name>password</name><value>dingbats</value></parameter>
         <parameter><name>url</name><value>jdbc:postgresql:db</value></parameter>
      <parameter><name>driverClassName</name><value>org.postgresql.Driver</value></parameter></ResourceParams>You need an resource ref entry in your web.xml too:
    <resource-ref>
      <res-ref-name>jdcn/testDb</res-ref-name>
      <res-type>javax.sql.DataSource<res-type>
    </resource-ref>You can only use this set up in code run under Tomcat, the jndi context only exits inside the Tomcat container.

  • How create data block corruption for test DBMS_REPAIR

    Hello to all
    I wanna create data block corruption in a table for testing Dbms_repair
    is it possible ? if yes please say to me how I can do it ,by example please
    thanks

    thank you so much that link was helpful (specially it's last respond)
    I could create data block corruption and I tested DBMS_REPAIR and RMAN for data block recovery
    but now I got head spin that if we have rman backup from database so using dbms_repair is what for?
    while we can recover corrupted data blocks
    please guide me
    thanks

  • How to change JNDI settings for EJB, w/o BC4J

    How does one change the JNDI settings, name etc for an EJB ... without using a BC4J application module ?
    I have a simple Stateless Session Bean, I can deploy this to the database using the 'Deploy Classes To Oracle 8i' option but the bean does not show up in the 'test' JNDI context.
    From searching and reading the help files the only referrences that I can find for setting JNDI options are in the stuff reladted to application modules which are BC4J specific, I don't have a BC4J project and I don't want a BC4J project.
    Suggestions ?

    More information... I believe that the reason I do not get to change JNDI settings is because I am not choosing the 'Enterprise Java Bean (EJB) to Oracle8i' deployment type in the deployment wizard.
    The reason I don't pick it is ... because its not there !
    So, why does this option not appear in my deployment types. Could it be related to my Oracle client configuration which pre-dates my JDeveloper setup and is for an earlier version of the Oracle database ?

  • Can anyone give an example of how to configure a DataSource using Mysql driver?

    thanks in advance.

    Hi Jack,
    I don't have an answer for you -- just some suggestions.
    Yes, I know it's a silly question, and please excuse me, but have
    you looked at the documentation? I think this web page will be relevant:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/web.902/a95879/ds.htm#1004903
    The following web sites may also be useful (if you haven't already
    looked at them, of-course :-)
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.atlassian.com
    http://www.elephantwalker.com
    Good Luck,
    Avi.

Maybe you are looking for