Configure database connection after deploy to Tomcat

I developed a Web Application in JDeveloper. The database connection is defined in data-sources.xml for internal testing. When I deploy my application to Oracel Application Server, I can configure data sources in Oracle application server. My question is: when I deploy my application to Tomcat, I followed Tomcat document to create data source in Tomcat, but where is the java code to change to database connection in the application created in JDeveloper?

Hi,
Java EE data sources is a standard. If e.g. you reference jdbc/hrconn in your application (you don't mention what you use) then configuring this as a JNDI name for the data source in Tomcat should be enough to get it working
Frank

Similar Messages

  • Changing the Database connection after deployment.

    Dear All,
    I have deployed an application and want to change the connection to live database so how do i change it..
    Do i have to redeploy the application ?. Both db's are oracle.
    -Thanks

    Hi Santosh,
    As Frank said u can connect ur Application using a JDBC Datasource.. So u can change in ur Connection Settings in WLS... u can find the documentation as below....
    Section 9.3.1 http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcservices.htm#sm0203
    For Weblogic Server : Section 35.8 http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/deployment_topics.htm#CHDFJADJ
    Regards,
    Suganth.G

  • How to correct close database connection after report generation

    Hello
    I have problem a with alive database connection after report creation and report  closing. How to properly to close connection to database?
    Best regards
    Edited by: punkers84 on Jun 17, 2011 10:38 AM

    that's what I am doing... after viewing the report, I call the close method on the window closing event of the container window. but the connection is still open. I had a lot of other issues with my jdbc driver but after downgrading to an older version those issues are resolved.Only this one is still there! Is there any other way to close the connection (like using dbcontroller or etc.)?

  • 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

  • Unable to open database connection after applicaiton is running for several days.

    Has anyone experienced a similar error to this:
    After about 3 days of use our application starts to report errors opening
    the database connection. By that time we've had thousands of transactions
    happen. Oracle is only showing a few open connections to our iAS host so
    the error seems to indicate the connection pool. I'm configured for 64
    connections (the default). We are using the Oracle native driver on iAS
    SP3, Solaris.
    The iAS ksvradmin monitor gives errors when trying to see how many open
    connections it has (verified bug in SP3), so I can't get any info from iAS
    on the connection pool.
    Thanks in advance,
    Rodger Ball
    Sr. Engineer
    Business Wire

    iAS6 SP3 and earlier cannot detect dead connections. If connections become
    stale, iAS does not detect this and will hand out these stale connections.
    I don't know enough about your problem, but you can check for this.
    hope this helps,
    -James
    "Rodger Ball" <[email protected]> wrote in message
    news:9suucb$[email protected]..
    Has anyone experienced a similar error to this:
    After about 3 days of use our application starts to report errors opening
    the database connection. By that time we've had thousands of transactions
    happen. Oracle is only showing a few open connections to our iAS host so
    the error seems to indicate the connection pool. I'm configured for 64
    connections (the default). We are using the Oracle native driver on iAS
    SP3, Solaris.
    The iAS ksvradmin monitor gives errors when trying to see how many open
    connections it has (verified bug in SP3), so I can't get any info from iAS
    on the connection pool.
    Thanks in advance,
    Rodger Ball
    Sr. Engineer
    Business Wire

  • How TO use configurable Database connection with ADF BC

    I have developed a simple JSF/ ADF BC web application that connects to a database and read/display data from the db tables. I have successfully deployed the application to Tomcat 5.5.17. However, now i need to change the database the application is connecting to. My question is How can I change the Database connection without having to change the application modules or rebuild the war file ??? In other words, is there a specific file (xml) where the database connection can be changed?

    If you set up the application with a data source (I am not sure if this is possible using another app server, I use OC4J), then you would just change it there. However if you created a database connection in the JDEV and pointed your data model to that, then you will have to change and rebuild.
    You might be able to edit the xml file that contains the setttings, I am not sure my CM guys dont allow this, all of our changes have to go through our code repository.

  • Configure Database Connection to Weblogic 8.1 Connection Pool

    Hi,
    I've got an ADF BC web application which is working find for an embedded JDBC Oracle Database connection. It's Jdeveloper 10.1.2 deployed to Weblogic 8.1.
    Now I'm trying to change the Database connection so it can point to a weblogic connection pool through its JNDI name. The goal is to make .ear file transportable through different weblogic domains and databases, without recompile application.
    I've been trying to configure an "OracleConnectionPoolDataSource" selecting "third party driver" in Database connection wizard, but Jdeveloper throws error: Java Cast Exception, and don't let continue. What else have to do?
    thanks.

    I did that, but WebLogic ignores whatever I configure in Services->JDB->Connection Pools and Data Sources. Even if I remove them the application keeps on running.
    Because the server only reads the connection defined from JDeveloper, which is configured in the connections.xml file placed inside the deployed .ear file.
    I need to change this behaviour, and configure connections.xml pointing to Weblogic Datasource.
    Thanks for your attention.

  • Closing the database connection after report in a server application

    I searched these forums and the internet for a definitive answer on asking the Crystal SDK for java to close the jdbc connection after it has generated a report.  We have been using the Crystal Report SDK to generate reports within our JEE application, built upon the Spring framework, for the past two years.  It works well, especially if you prepare views in the database for your reports.
    From what I can tell once you have used ReportClientDocument to create your report you all the close() method to release resources associated with report generation, but this does not close the jdbc database connection.
    Further research states that if you are using the CrystalReportViewer you can call the dispose method to close the database connection.  We are not using JSP nor this class, so that does us little good.
    Finally I found a post that one could call ((AdvancedReportDocument)reportClientDocument.getReportSource()).dispose().  This doesn't drop the connection either.
    Each report actually opens 3 connections according to SQL Server.  Each report will reuse the connections it has open, so for 50 reports, theoretically, we could have up to 150 connections.  We explained to our client those connections  remain inactive, however this is unacceptable to our client as they would like to minimize the number of connections left open to their database.
    If anyone can post any further information on this issue, it is much appreciated.

    Yes, another team member found the issue.  Quite embarrassing really I didn't see it.  I was looking for the answer within Crystal's libraries.  It had nothing to do with Crystal.
    The developer who wrote the helper code for using Crystal first opened a connection to the datasource for the live production database and read that connection information for the report. Next he set that connection information in the report template's PropertyBag, then ran the report. The developer however forgot to close the connection he used to look up the connection info, leaving a memory leak and using up all the connections.
    I'm glad you inquired.  I forgot to post the resolution here.

  • Sharepoint 2013 MP - Configuration Database connection failed

    Hi all!
    I run a WS2012 R2 with SCOM 2012R2. I'm trying to monitor Sharepoint 2013 Farm, with the Sharepoint 2013 MP. The Sharepoint farm and it's SQL server is on another domain, with two-way trust, and the agents are working on the Sharepoint and SQL servers.
    I use SQL aliases for Sharepoint DB's, so I've made an override to the connection string to make it connect to the correct database. 
    The override is working fine, I can see that SCOM is trying to connect to the SQL server, but I cannot seem to make SCOM use the correct Run As account on these configuration databases. Most of the Sharepoint MP seems to be working fine, with the farm admin
    account, but I don't know how I can force this override connectionString to use a specific user.
    WS2012R2 with SCOM2012R2 UR3
    Sharepoint 2013 Farm on WS2008R2 OS.
    MS SQL 2012 on WS2008R2.
    It uses the default SCOM monitoring account, instead of the Sharepoint RunAs account.
    Any suggestions?
    How do I make it use the correct Run As account?
    (This guy has the
    same problem)
    Thanks,
    Nikolaj

    I was looking at this issue not too long ago, and looked through the management pack xml, to see if there was a missing secure reference for DB connection monitors. I only glanced through the MP, but it looked to me as if the DB connection
    monitors references the same account as the other sharepoint monitors. (Yes, that full-blown farm admin account). Again I am not sure, but it seems the management pack has trouble using the referenced RunAs account in the connection strings and then, because
    the watcher node is setup default to run off the management server, it falls back to the management server action account.
    You mention, that you have a two-way trust between you management group and SPS SQL servers. You could then bring this to work by granting your management server action account public rights on your configuration and content DB’s. Not
    optimal, but it’s a workaround. For SPS 2013 this should work without changing the connection strings, as you would have to with SPS 2010.
    I know this is not solution you’re are looking for, but it just might be enough for you to get a step further. I don’t know of any solution, so far, to get the DB connections to use the SPS RunAs account.

  • 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

  • Bc4j.xcfg, database connections and deploying ADF apps to oc4j

    I'm trying to understand how to enable custom database connections on a JDeveloper ADF application deployed to a stand-alone instance of OC4J.
    All entity objects were created as ADF Business Components.
    I looks like the db connection information used by the application is stored in a file named "bc4j.xcfg".
    How would I change the database connection information between different environments, changing the server, port and password information from an OC4J instance?
    I'd like to use an OC4J defined data-sources.xml file, but am looking for the simplest approach for now.

    Tomato tomaato, call it what you will, we now have to spend time (money) figuring out how to change from using the recommended use of a "connection" from Oracle tutorials and in Oracle Press books.
    Plus, neither I nor our client can get JDeveloper ADF 10.1.3 to work on OAS 10.1.2.
    Oracle has been of little help, other than stating to follow documentation. We followed the documentation at least a dozen times and on three different install of OAS 10.1.2.
    Why doesn't JDeveloper have a check-box or button that reconfigures the application to run on 10.1.2 (J2EE 1.3), there is a check-box to change JDK versions (1.4)? This is suspect to me.
    We are going to be speaking with the client this week, and have to state the ADF application works, but NOT on OAS 10.1.2.
    Does ADF work on OAS 10.1.3, absolutely, but the client is in 10.1.2 and can not upgrade at this time.
    I've read in blogs where lots of developers have the same issues without resolution and Oracle should just come out and state that 10.1.3 does not work on 10.1.2.
    So my experience has been a mixed bag with ADF, both in terms of the software and customer support from Oracle.

  • Configuration Database issue while Deployment.

    Hi,
    I have a BizTalk 2010 project which I want to deploy on a remote server. When I go to
    Properties-> Deployment -> Server and enter the Server name as 'RemoteServer'. I see an error in the Configuration Database:
    <No BizTalk Configuration database(s) found on server 'RemoteServer'.>
    and when I try to deploy I get error: Parameter name: strDBName
    However, when I open other projects, they already have Server 'RemoteServer' selected and Configuration database as 'BizTalkMgmtDb'. Also, I can successfully deploy these projects to the 'RemoteServer'. So, why in this project
    I'm not getting any Configuration database?
    Please help.
    Thanks.
    Kunal G

    Hi Kunal,
    I did some more work on this.
    Case 4:
    In Visual Studio’s “Deployment" panes --> Server, if I select any server where I don't have Login permission, then I get the Login error as you have mentioned:
    "Login failed for user 'domainNameAprabhu'."
    Resolution to Case 3:
    In case 4,  what I also noticed is when I update the existing Server name (server name where my BizTalkMgmtDb exist) in the Deployment pane, the drop down box unable to recognize the
    new SQL server (or not able to refresh the Databasename when any change happen to the Server name) failed with the error:
    <No BizTalk Configuration database(s) found on server 'SQL Serer Name'>
    However, if I start a new project from scratch, the application can easily find BizTalkMgmtDb.
    Then I logged into the database server where the BizTalkMgmtDb exist --> Security --> Logins --> Selected the group where my login (login to the machine where I have SQL Server, if database in the
    same machine as Visual studio then you can do this in the same server) --> Properties --> Server Roles --> Check "sysadmin" access.
    Then I came back to my Visual Studio, closed and restarted the Visual Studio, went to the Deployment pane in the Server property, I can now get the BizTalkMgmtDb without any issue. It’s a guaranteed privilege
    issue.
    Regards,
    M.R.ASHWINPRABHU
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

  • Database Connection problem (JSP, Oracle & Tomcat 5.5)

    I am trying connect to Oracle 8 database through JSP and the webserver is Tomcat5.5. The classes.jar file is in the Tomcat5.5\common\lib directory and the path has also been set to mentioned directory. But I am getting exceptions. The code and the error are given below.
    Need help at the earliest.
    Thanks in advance.
    CODE
    Class.forName ("oracle.jdbc.driver.OracleDriver");     
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@insrs013:1521:GCR","BILLING_USER", "BILLING_USER");
    PreparedStatement pstmt = null;
    ResultSet rs = null;     
    pstmt = con.prepareStatement("INSERT INTO PROJECTIP(PROJECTID, PROJECTSERVERNAME, SERVERIP) VALUES(?,?,?)");
    ERROR
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: oracle.jdbc.driver.OracleDriver
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.test.ServerIPDataSave_jsp._jspService(org.apache.jsp.test.ServerIPDataSave_jsp:137)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1338)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:127)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
         java.lang.ClassLoader.loadClassInternal(Unknown Source)
         java.lang.Class.forName0(Native Method)
         java.lang.Class.forName(Unknown Source)
         org.apache.jsp.test.ServerIPDataSave_jsp._jspService(org.apache.jsp.test.ServerIPDataSave_jsp:71)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Hope is only the love of life.

    hi,
    FIrst make one thing clear. By classes.jar you mean either classes111.jar or classes12.jar.Right?If not,please check tht.
    Also,u needn't set any classpaths for Tomcat.
    Regards,
    Viswanath.

  • "Error establishing a database connection" after scale database

    Hello, i have a wordpress website hosted at my azure account (www.timothy-k.com). I was trying to scale my sql database and i have changed it from standard to basic. Then, I cant connect to my site, because i have this error.
    I scale the database again from basic to standard but the issue persists.
    In the website dashboard I can see an another mysql db as a linked resource.I check the credentials for wp-config and they are ok.
    Can you help me?

    Hi DigitalJo,
    Are you moving between the service tiers using the Azure Management Portal? Can we have the error which you get?
    Connections to the database may be temporarily dropped when a performance level change or upgrade/downgrade completes, and a few seconds may elapse before connections can be re-established. SQL Database applications should be coded to be resilient to dropped
    connections as this can occur anytime in SQL Database when a computer fails in the data center and the SQL Database service fails over the database.
    Reference :
    https://msdn.microsoft.com/en-us/library/azure/dn369872.aspx
    Regards,
    Mekh.

  • Configuring Database connection at runtime

    Hi,
    I am new to JDBC and urgently needs ur help.
    What I want is to provide the URL (Connection String and DB info) in a config file and read that in the code. Also I should be able to change the DB location and connection string at runtime so that the next time the code executes, it takes the new connection string. I heard something about MBeans, can anyone help me in this.
    Thanks in advance
    Pankaj
    PS: I might use JBoss or Tomcat.

    Thanks for the reply..
    Yes, but how to do it using MBean? Is Mbean the only solution available or there are some better approaches?
    regards
    Pankaj

Maybe you are looking for