How to configure database connectivity in OC4J App server.

Hi,
I am working on Oracle ESB flows. I have the flow inserting rows into database table using database connection that I have defined. I havent set up connection settings in OC4J EM console.
I dont wonder when JDeveloper is inserting rows into tables, as connection is explicitely defined in JDeveloper.
Now I login to EM enviroment and click on Home, click on Web Services tab, and when I use this flow as a Web Service end point and feed values through the form that it provided, it also works. But since I havent defined any connection properties in App Server explicitely, I wonder where is it getting connection properties(JNDI name) from.
I want to configure some settings in Testing Environment and am kind of stuck at this point.
Thanks,

Hi.
When you don't have JNDI configured, OC4J uses the design time connection defined in the Adapter's WSDL. Look for the following description in your Adapter WSDL:
<!-- Your runtime connection is declared in
J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml
These 'mcf' properties here are from your design time connection and
save you from having to edit that file and restart the application server
if your JNDI is missing.
These 'mcf' properties are safe to remove.
-->
Now, for JNDI configuration, you can use the SOA Suite tutorial as a reference:
http://download.oracle.com/docs/cd/B31017_01/core.1013/b28937/setting_up.htm#CIHBHEFC
There you can find the steps to create a connection pool, data source, etc.
Denis

Similar Messages

  • How to access  database connection from datatsource in a standalone java ap

    My java standalone application wants connection to database with lookup to datasource name which is configured in the oc4j app server.
    Please guide me with some ideas to acheieve this.

    user510497,
    Following sample program requires access to classes in "oc4j.jar" file.
    Test environment:
    * Server:
    + OC4J stand-alone 10.1.2.0.2
    + Red Hat Enterprise Linux AS release 3
    + Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
    + Oracle Database 10g Release 10.1.0.4.0 - 64bit Production
    * Client
    + Microsoft Windows XP Professional Version 2002 Service Pack 2
    + Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode, sharing)
    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.SQLException;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
    public class DataSrc2 {
      public static void main(String[] args) {
        Connection conn = null;
        Properties l_props = new Properties();
        l_props.put(Context.INITIAL_CONTEXT_FACTORY,
                    "com.evermind.server.rmi.RMIInitialContextFactory");
        l_props.put(Context.PROVIDER_URL, "ormi://your_OC4J_host/");
        l_props.put(Context.SECURITY_PRINCIPAL, "your_OC4J_user");
        l_props.put(Context.SECURITY_CREDENTIALS, "your_OC4J_password");
        Context l_jndiContext = null;
        try {
          l_jndiContext = new InitialContext(l_props);
          Object l_obj = l_jndiContext.lookup("default-data-source");
          DataSource ds = (DataSource) l_obj;
          conn = ds.getConnection("scott","tiger");
          DatabaseMetaData dbmd = conn.getMetaData();
          System.out.println(dbmd.getDatabaseProductVersion());
        catch (NamingException x_naming) {
          x_naming.printStackTrace();
        catch (SQLException xSql) {
          xSql.printStackTrace();
        finally {
          if (l_jndiContext != null) {
            try {
              l_jndiContext.close();
            catch (NamingException x_naming) {
              System.err.println("Failed to close JNDI context.");
              x_naming.printStackTrace();
          if (conn != null) {
            try {
              conn.close();
            catch (SQLException xSql) {
              System.err.println("Failed to close [database] connection.");
              xSql.printStackTrace();
    }NOTES:
    1. Datasource lookup name is value of "default-data-source" attribute of "orion-application" element in file:
    <OC4J_HOME>/j2ee/home/config/application.xmlGood Luck,
    Avi.

  • How to close database connections in Crystal Reports

    I am using the following code to connect to database. I can either pass JNDIName or I can provide values for others by leaving JNDI name empty.
    If i use JNDI name, it will use a connection from the connection pool of App Server (in my case Weblogic), but it is not releasing the connection after use. Connection remains even if I logoff from the application. If i keep my max connections as 15 in weblogic, after clicking the page with crystal report 15 times all will remain active and users will not be able to login to the application.
    If i use connectionString and others without using JNDI Name, it directly connects to database. So it creates a connection in database server directly without using connection pool of weblogic. If i check weblogic, it shows no connection in use as expected, but if i check database, i can see the no. of connections increasing everytime a user clicks a crystal report page.
    When the connection touches the maximum allowed connection in server, every application using the same server goes down
    How can I close the connection which was created for the viewing the report?
    String reportName = "/reports/BankBalance.rpt";
    ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);
    if (clientDoc == null)
             clientDoc = new ReportClientDocument();
             clientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);
            // Open report
            clientDoc.open(reportName, OpenReportOptions._openAsReadOnly);
           String connectString = ""; // jdbc:sybase:Tds:DBSERVERNAME:9812/DBNAME?ServiceName=DBNAME
           String driverName = "";    // com.sybase.jdbc3.jdbc.SybDriver
           String JNDIName = "DS_APP";
           String userName = "";
           String password = "";
           // Switch all tables on the main report and sub reports
           CRJavaHelper.changeDataSource(clientDoc, userName, password, connectString, driverName, JNDIName);
         // logon to database
          CRJavaHelper.logonDataSource(clientDoc, userName, password);
    // Store the report document in session
    session.setAttribute(reportName, clientDoc);
                   // Create the CrystalReportViewer object
                          CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();
         String reportSourceSessionKey = reportName+"ReportSource";
         Object reportSource = session.getAttribute(reportSourceSessionKey);
         if (reportSource == null)
              reportSource = clientDoc.getReportSource();
              session.setAttribute(reportSourceSessionKey, reportSource);
         //     set the reportsource property of the viewer
         crystalReportPageViewer.setReportSource(reportSource);
         crystalReportPageViewer.setHasRefreshButton(true);
         crystalReportPageViewer.setToolPanelViewType(CrToolPanelViewTypeEnum.none);
         // Process the report
         crystalReportPageViewer.processHttpRequest(request, response, application, null);

    the sample shows how to clear RAS and Enterprise resources after viewing report.
    1. If you use unmanaged RAS - as I can see you using setReportAppServer, then remove the enterprise related stuff : instantiating and cleaning code.
    The sample code is meant to give you an idea on how you can release the resources after done with viewing report. In your case all you need to do for cleaning is call close() on ReportDocumentObject. The sample will need to be modified for your requirements.

  • Oc4j starting with Oracle Database & oc4j App Server on same machine

    Hi ALL, can anybody help me(pls read this)
    This is Sagar, i have created a GIS Application(java) using Oracle 10g.
    Senario I:
    oc4j server and oracle 10g Database Server on different machines:
    When i start oc4j server with NO. OF Mappers = 64 or 30 in DNS using
    1. oc4j -start (normally)
    from the path c:/oc4j/bin by setting ORACLE_HOME path normally
    application is working fine but when users are increased say 4 to 5 oc4j server gives error:
    java.lang.OutOfMemoryError: Java Heap Space
    I searched for this error i found a solution for starting oc4j as follows:
    2.Java -Xmx1024m -Xms1024m -jar oc4j.jar
    from the path c:/oc4j/j2ee/home --- oc4j.jar
    Then map & application works fine and fast since heap space is increased to 1GB (speed is noticable)
    but if...(in other senario)
    Senario II:
    oc4j server and oracle 10g Database Server on same machine:
    if step 2: is used form above senario, oc4j Server does not gets started only it gets initialized...(server does not gets started)
    but Step 1: is used application works fine but again heap space error as mentioned above is seen.
    Again if changes are made in oc4j.cmd file in c:/oc4j/bin ....by giving the heap space command oc4j works fine but the application(performance) is very very slow but heap space error is not seen.
    Please can any body suggest the solution.. application should work fast and also the heap space should be increased but taking the senario - oc4j App Server & Oracle 10g Database Server on Same machine..

    Hello,
    How much RAM do you have on the machine? What is the size of the SGA for the database you are using?
    if step 2: is used form above senario, oc4j Server does not gets started only it gets >initialized...(server does not gets started)What do you mean by this? Provide the output from the server when you start your server.

  • How to close database connections

    I am using the following code to connect to database. I can either pass JNDIName or I can provide values for others by leaving JNDI name empty.
    If i use JNDI name, it will use a connection from the connection pool of App Server (in my case Weblogic), but it is not releasing the connection after use. Connection remains even if I logoff from the application
    String reportName = "/reports/BankBalance.rpt";
    ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);
    if (clientDoc == null)
    clientDoc = new ReportClientDocument();
                   clientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);
    // Store the report document in session
    session.setAttribute(reportName, clientDoc);
    String connectString = ""; // jdbc:sybase:Tds:DBSERVERNAME:9812/DBNAME?ServiceName=DBNAME
    String driverName = "";    // com.sybase.jdbc3.jdbc.SybDriver
    String JNDIName = "DS_APP";
    String userName = "";
    String password = "";
    CRJavaHelper.changeDataSource(clientDoc, userName, password, connectString, driverName, JNDIName);
    CRJavaHelper.logonDataSource(clientDoc, userName, password);
    // Store the report document in session
    session.setAttribute(reportName, clientDoc);
    // Process the report
    crystalReportPageViewer.processHttpRequest(request, response, application, null);

    the sample shows how to clear RAS and Enterprise resources after viewing report.
    1. If you use unmanaged RAS - as I can see you using setReportAppServer, then remove the enterprise related stuff : instantiating and cleaning code.
    The sample code is meant to give you an idea on how you can release the resources after done with viewing report. In your case all you need to do for cleaning is call close() on ReportDocumentObject. The sample will need to be modified for your requirements.

  • How to configure JDBC connection in oracle BI publisher with teradata datab

    Hi,
    I am going to use Oracle BI publisher to create report.
    Our database is Teradata.
    How to create database connection for Teradata in BI publisher.
    How to create JDBC connection.
    What should be the Database Driver Class?
    What should be the connection string format?
    Please provide me the suggetion.
    Thanks,
    Santanu Manna

    Hi;
    I suggest please refer below which could be helpful on your issue:
    How To Generate XML Output (Excel, HTML, PDF) for FSG Reports [ID 804913.1]
    E-XMLP: BI Publisher Report RTF Template to Excel output is not same as PDF,RTF or HTML format.[Article ID 1515711.1]
    BI Publisher Enterprise Excel Output File Size is Too Large [ID 1271544.1]
    Regard
    Helios

  • How to configure informix connection pool in sun-one appserver 7

    Hello,
    Anybody knows , How to configure informix connection pool properties in sun-one appserver 7?
    Thanks in advance.

    Actually,it couldn't get some advice in here.But now,I known how to configure it,I expended 2 days to search and test it.Follow :
    jdbc class:com.informix.jdbcx.IfxDataSource
    serverName=(INFORMIXSERVER)
    portNumber=1526(default)
    IfxIFXHOST=(host ip)
    databaseName=(your dbname)
    user=(your username)
    password=(your pwd)
    attention:configure right transaction and userthreads in your informix sever
    Hope helpful to someone!

  • When and How to close database connection in JSP?

    Hi there,
    I am using MySQL and JDBC 3.0, in my system, When and How to close database connection in JSP?
    Thanks in advance.
    Lonely Wolf
    <%@ page session="true" language="java" %>
    <jsp:include page="checkauthorization.jsp" />
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <%--
    Execute query, with wildcard characters added to the
    parameter values used in the search criteria
    --%>
    <sql:query var="availablecomputerList" dataSource="jdbc/Bookingcomputer" scope="request">
    SELECT * FROM computer where status=0
    order by s_code
    </sql:query>
    <html>
    <head>
    <title>Search Result</title>
    </head>
    <body bgcolor="white">
    <center>
    <form action="checkin.jsp" method="post">
    <input type="submit" value="Back to Check-in Page">
    </form>
    <c:choose>
    <c:when test="${availablecomputerList.rowCount == 0}">
    Sorry, no available computer found.
    </c:when>
    <c:otherwise>
    The following available computers were found:
    <table border="1">
    <th>Computer</th>
    <th>Description</th>
    <th>Status</th>
    <c:forEach items="${availablecomputerList.rows}" var="row">
    <tr>
    <td><c:out value="${row.s_code}" /></td>
    <td><c:out value="${row.description}" /></td>
    <td><c:out value="${row.status}" /></td>
    </tr>
    </c:forEach>
    </table>
    </c:otherwise>
    </c:choose>
    </center>
    </body>
    </html>

    when should you close the connection? when you're done with it.
    how should you close the connection? like this: conn.close();
    that said, doing this in a JSP page is bad form and not recommended
    JSP's typically don't contain ANY business or data logic

  • How to migrate SharePoint 2013 Content and Configuration DataBases to a new SQL Server and DataBases in it?

    Hi,
    We need to migrate Our current 1 clustered SQL Server, Many Configurations DataBases and Many Content DataBases to a brand new clustered SQL server and brand new databases in it.
    How can I do this?
    Can someone list the steps involved?
    Thanks.  

    Hi,
    According to your description, you want to move Content databases  and Configuration databases to a new SQL Server,  refer to this article:
    https://technet.microsoft.com/en-us/library/cc512725.aspx?f=255&MSPPError=-2147217396
    Besides, here is a similar post, you can use as a reference:
    https://social.technet.microsoft.com/Forums/office/en-US/2cd46f7a-d583-41b2-82c2-ddc6d7c43fb8/how-to-move-sharepoint-databases-to-new-sql-server?forum=sharepointadminprevious
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Configuring database connection (metadata repository) from jsp

    anybody could help me to configuring database connection from portal schema from jsp page.
    i dont have idea.
    Thanks.

    Hi,
    You won't be able to access the DB connections used by iAS from the JSP. As these connections are managed by mod_plsql component in iAS.
    Thanks,
    Ved

  • How to get database connection in applet

    Hi,
    I am trying to prepare database connection in applet. After preparing connection with database it'll read same values from table.
    At the time of development it works fine. I have used esclipse IDE for coding and testing.
    But when I try to call that applet from browser. It is giving ClassNotFound exception.
    Does anybody know How to get database connection in applet ?
    Please help me if anybody know solution for this.
    Thanks,
    Rajesh

    As per my knowledge is conserned
    1 u can get the database connection in a jsp page and u send the result set as param to the applet and u can use retrieved values as if they were of the same applet if u r interested i can send the db connetion coding for jsp my id [email protected]

  • How to configure BT connection from PDA?

    Hello :)
    PDA cannot find the ActiveSync service, though Windows Mobile Device Center 6.1 is running, and COM port is configured appropriately.
    PDA HTC P3300 Artemis-WinMob 5.0, USB Bluettoth adapter, last version 7.10.10
    in IVT BlueSoleil works fine
    Manual *"How to configure a connection from the PDA (Windows Mobile 6) to the Windows Mobile Device Center"* not help
    Windows 7 64bit

    My HTC Windows Mobile 6.1 phone (not your model) in combination with Windows7 x64 and Windows Mobile Device Center works just fine for me with Bluetooth stack v7.10.10 (T). Ensure that you use the suitable x64 bit version of the Windows Mobile Device Center.
    Here are my links:
    http://www.microsoft.com/windowsmobile/en-us/downloads/microsoft/device-center-download.mspx
    http://www.microsoft.com/downloads/details.aspx?FamilyId=4F68EB56-7825-43B2-AC89-2030ED98ED95&displaylang=en

  • How can i check the office web app server(wac client) is calling custom WOPI host?

    I am getting an error when I testing my wopi host(which is the same as
    example) with Office Web app server "Sorry, there was a problem and we can't open this document.  If this happens again, try opening the document in Microsoft Word."
    1-how can find the log files of this error?
    2-how can i check the office web app server(wac client) is calling my WOPI host?
    I am not sure about cumunication between owa to wopi host. I actually dont know how to implement checkfile and getfile functions to wopi host for waiting for call back from owa client.
    Note:I am sure that office web app server is configured true. Because i test it with sharepoint 2013 and editing and viewing is working well.

    Hi,
    According to your post, my understanding is that
    CheckFileInfo is how the WOPI application gets information about the file and the permissions a user has on the file. It should have a URL that looks like this:
    HTTP://server/<...>/wopi*/files/<id>?access_token=<token>
    While CheckFileInfo provides information about a file, GetFile returns the file itself. It should have a URL that looks like this:
    HTTP://server/<...>/wopi*/files/<id>/contents?access_token=<token>
    There is a great article for your reference.
    http://blogs.msdn.com/b/officedevdocs/archive/2013/03/20/introducing-wopi.aspx
    You can also refer to the following article which is about building an Office Web Apps(OWA) WOPI Host.
    http://blogs.msdn.com/b/scicoria/archive/2013/07/22/building-an-office-web-apps-owa-wopi-host.aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Find how many users are connected in the Oracle Server

    Hi,
    I am using Oracle 10g. My question is, is it possible to find how many users are connected in the Oracle Server. We are having one Server and we are having many client machines which will connect the Oracle.
    And one more question in the meanwhile i want to take Backup of one database which client as connected. Is it get any problem to the client machine which is accessing the server. And How to take the backup from the server machine. Any commands to process.
    Thank u...!

    Hi there.
    If You run
    select count(*) from v$session where username is not null;you'll get the number of users connected to Oracle server,
    and yes , you could do backup while users are connect to db you are backing up.
    cheers

  • How to configure sync with my local ftp server?

    I have used XMarks since now because it hallow me to synchronize my bookmarks with my local server. Now XMarks don't work anymore because it's not more possible to synchronize the passwords.
    Any other alternative imposes to use an external server and I don't want to use an external server. My data must remain on my machine it's absolutely excluded that i use an external unknown server for this.
    The only solution must be a free solution (a real free solution) and the firefox synchronization seems to me the best/only one.
    But I've not found how to configure it to use my own server.
    So how to do it, where are the options to the synchronizer to give my own ftp server or whatever other server it needs?

    iAS 6.0 sp4 officially does only support iPlanet Directory Server 5.0 sp1 and 4.13.
    For more details visit: http://docs.iplanet.com/docs/manuals/ias/60/sp4/ig/prep.htm#42084
    I guess, you can specify the directory server during the time of installation.
    Thanks,
    Rakesh.

Maybe you are looking for

  • Please help me :( , ipod 5th gen 30 gb unrecognized , i swear big prize for one who have a solution for it

    hello all my name is Saray, I'm a 4th year Computer Engineering student, I'm from Spain and I often go to U.S.A I even had my eng course there last summer ... Anyhow my problem is with my 5th generation 30gb ipod which I have exchanged it with a harm

  • Pen drive write protected - Unable to format

    I have a usb pen drive mounted. I cannot create any folder or delete any file. It says read only mode. I also tried to formate it using the gparted tool, it says partition read only I tried dd command it also says partition is read only file system s

  • Applet tag

    Hi guys i'm having a bit of a problem with an applet. I have an applet i am trying to run which imports one of my own classes from a different package. When i run this applet i get a NoClassDefFoundError on this imported class. I dont understand what

  • BAPI_PRODORD_CHANGE in a loop - Error CO469

    Hi all, I´m trying to update a few production orders in an own report. The order numbers are stored in an internal table. The processing is done on a loop. The problem is, that i always/sometime get an error CO469, which says that on of the productio

  • Replace the connection string in Excel MDS file

    I had MDS solution from one SQL Server 2012 to another - SQL Server 2014. I have configured Excel file with connection to MDS. How can I safely to replace the connection string in my Excel MDS file and the tables is not broken? from Moscow with money