How to setup and use connection pool in Web AS 7.0?

Hello SDN!
I'm developing a Web Dynpro Java application on SAP Web AS 7.0 My app using a couple of DAO classes as model instead of EJBs. These classes perform direct requests to database using JDBC drivers.
I've read that many of web-servers use their own connection pools. So I want to know:
1) how I can setup connection pool in SAP Web AS ?
2) how I can call this pool in my application?
Could you please give me some examples?
Regards, Lev.

hi lev,
check this document for jco pools
http://www.winfobase.de/lehre/lv_materialien.nsf/intern01/FB09D79A41930E34C125709F0046180C/$FILE/Tips&Tricks_JCo_Programming.pdf
ravindra

Similar Messages

  • How to setup and use Passbook on iPhone 4?

    How to setup and use Passbook on iPhone 4?

    So your saying you can only copy part of this text?

  • Where can I learn how to setup and use the new features in Mountain Lion?

    Where can I learn how to setup and use the new features in Mountain Lion?

    MacWorld has a Superguide, TidBITS has Take Control books, and probably a flock of other publishers have physical books.

  • How to get and use connection from Web AS 7.0 pool?

    Hello!
    I've set up a datasource and connection pool in my Web AS according http://help.sap.com/saphelp_nw70/helpdata/en/c0/3ad4d5cdc66447a188b582aad537d3/frameset.htm
    And I have some questions about using connection pool:
    1) here is my code which get connection form pool:
    InitialContext ctx = new InitialContext();
    DataSource datasource = (DataSource) ctx.lookup("jdbc/IndexesDataSource");
    Connection con = datasource.getConnection();
    return con;
    Does it properly?
    2) Which method I should call when I need to pass connection back to the pool? Will it be enough to call con.close()?
    regards, Lev

    Hi Lev,
    Write code like this
    try{
    InitialContext ctx=new InitialContext();
    DataSource ds=(DataSource)ctx.lookup("jdbc/indexsDataSource");
    Connection con=ds.getConnection();
    Statement stmt=con.createStatement();
    con.close();
    catch(Exception e)
    wdComponentAPI.getMessageManager().reportException("Exception "+e,true);
    also have a look at below links[Link|http://help.sap.com/saphelp_nw04/helpdata/en/61/fdbc3d16f39e33e10000000a11405a/frameset.htm][Link1|http://help.sap.com/saphelp_nw04/helpdata/en/46/ddc4705e911f43a611840d8decb5f6/frameset.htm][Tutorial|http://help.sap.com/saphelp_nw04/helpdata/en/91/9c2226df76f64fa7783dcaa4534395/frameset.htm]
    Regards,
    Krishna kattu

  • How to setup and use usb superdrive

    I have a new iMac and purchased usb superdrive as well.  External superdrive does not appear to work and wonder if I am doing something wrong.  When I plug into usb port it does not appear on desktop or in Finder window.  When I insert a CD it brings in the cd and you hear it trying to read but nothing happens and the contents of cd do not show in a finder window.  After a while it ejects the cd.  What am I doing wrong.  Need to use the cd drive to install items.  Thanks for any help.

    Ralph,
    Thanks again.  Inserted a cd that I am sure is good which came fro Hewlett Packard and contained printer software and also a cd that contained just photo files and got same results on both cd's.  Assume the drive must be bad which seems strange, but guess possible.  Will take back to Apple tomorrow and let them check.  Thanks for your time!

  • How to use connection pool of datasource to make applications run faster?

    Hi, erveryone
    I prepare to implement a servlet that access database and do sync with client.
    When I access database, I would like to configure a datasource in weblogic and use connection pool.
    In order to make servlet application run significantly faster, my servet how to use connection poo is much moreresonable?
    For example, my servlet has many times database access. Is it true that geting and close a connection whenever
    one time database access finished?
    If from the servlet begins, the db connection is hold till servlet finalize. Will the solution affect the servlet performance? Is there any official document to introduce connection pool program? I search some documents.
    <The Java EE 6Tutorial> introduce some simple intruduction about connection pool.

    1. Use WebLogic Servers Data Source for Database Connections.
    2. Open and close the connections where you need it. Dont open it in begin and close in finalise. That is bad practice.
    3. Even when you invoke Connection.close () webLogic will not close the connection. it will commit the transaction and return it back to the pool rather than physically closing the DB connection.
    4. You can tune data source for minimum, maximum and increments of connections that you need based on your application requirement.

  • How to use Connection Pool in ADF ear file creaion from jDev 10.1.3

    Hi,
    We are developing big application in ADF with 10 different modules. We are creating ear file with data source setting.
    How to use connection pool while creating ear file from jDev. Connection pool is alreday created in Application Server 10g.
    What all the setting we need do to make use of connection pool while creating ear file jDev.
    Thanks

    User,
    If you are using ADF Business Components, you can right-click each application module, select "configurations" and edit the configuration you are using. On the initial page of the configuration dialog, you can specify to use either a JDBC URL or a Datasource - you just need to choose Datasource and then provide the name by which to access it.
    John

  • How to access database from applet using connection pooling.

    Hi,
    I am using tomcat 4.1, JRE 1.4.2_10, MySQL 5.0, and IE 6.0. I can access the database using connection pooling from JSP without problems. But, if I try to acess from the applet, I get the following exception (related to JNDI.):
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.lookup(Unknown Source)
    I know what this acception means, but I don't know how to fix it. I set up connection pooling in my Tomcat 4.1 that talks to MySQL 5.0. As I said, when I access from jsp, JNDI works. But, applet complains. Please help. In my applet, the following code accesses the database:
    ArrayList toolTipData =
          access.getToolTipData (projectName,interfac);This is the snipet of my Access class:
    public ArrayList getToolTipData (String projectName, String interfac) {
        System.out.println("In getToolTipData");
        ArrayList toolTipData = new ArrayList();
       try{
        Context ctx = new InitialContext();
        if(ctx == null )
            throw new Exception("No Context");
        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/interfacesDB");
        if (ds != null) {
          Connection conn = ds.getConnection();
          if(conn != null)  {
              Statement s = conn.createStatement();
              //For some reason paramtized queries don't work, so I am forced
              //to this in slighly less eficient way.
              ResultSet rst = s.executeQuery("select * from interfaces");
              while (rst.next()) {
                 if (rst.getString("Project_Name").equals(projectName) &&
                     rst.getString("Interface").equals(interfac)) {
                   System.out.println("getToolTipData: ITG #" + rst.getString("ITG"));
                   toolTipData.add("ITG #: " + rst.getString("ITG"));
                   toolTipData.add("SPNE Prime Name: " +
                                   rst.getString("SPNE_Prime_Name"));
                   toolTipData.add("PD Prime Name: " +
                                   rst.getString("PD_Prime_Name"));
                   toolTipData.add("IT Prime Name: " +
                                   rst.getString("IT_Prime_Name"));
                   toolTipData.add("MLC Priority: " +
                                   rst.getString("MLC_Priority"));
                   toolTipData.add("Gary's Prime: " + rst.getString("Garys_Prime"));
                   toolTipData.add("QA Prime: " + rst.getString("QA_Prime"));
                   toolTipData.add("Brief Description: " +
                                   rst.getString("Brief_Description"));
                   toolTipData.add("Project_Status: " +
                                   rst.getString("Project_Status"));
              conn.close();
      }catch(Exception e) {
        e.printStackTrace();
      return toolTipData;
    ....

    The jsp runs on the server, whereas the applet runs on the client so
    you must package with your applet any jndi implementation specific classes
    and
    Properties props = new Properties();
    props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
    props.setProperty("java.naming.provider.url", "url:1099");
    Context ctx = new InitialContext(props);
    Object ref = ctx.lookup("...");

  • How To Use Connection pooling with j2sdkee1.3?

    hi!
    How to use javax.sql.ConnectionPoolDataSource and
    javax.sql.PooledConnection with j2sdkee1.3.?
    In j2ee1.3's deployment tool,
    to specify the resource factories,
    javax.sql.ConnectionPoolDataSource is not available.
    Please Help me to use Connection pooling.
    Dhaya.

    Vendor implementations usually have a fair amount of optimization. For J2EE apps, my concern would be using your pool in transactional calls. When you make a transactional call across several beans/methods, the vendor's pool makes sure that you get the same connection each time you get a connection from the pool so that if you want to rollback the work (in case an error occurs), you can. Does your current connection pool support this?

  • How do i use Connection pool in JSP pages

    Hey everyone,
    I am using a connection pool in my web application. I am using DbConnectionBroker from Javaexchange.com. It has a class that creates a connection pool available for the servlets. I am trying to figure out that how to use connection pool within the JSP pages if I want to connect to the database. In the servlets i am using DBConnectionBroker pool = (DbConnectionBroker) getServletContext().getAttribute("dbPool") to get database connection. How Can i use this in JSP page to get a db connection.
    Thanks

    If the reference to the connection pool is already stored as an ServletContex attribute, try:
    <jsp:useBean id="dbPool" scope="application" class="com.javaexchange.dbConnectionBroker" />
    <%
    Connection con = dbPool.getConnection();
    %>

  • HT1515 How to setup laptop use both 3G internet and audio via Airport Express

    Laptop connected to internet via 3G mobile phone network, but when connected simultaneously an Airport Express to stream audio, the laptop can not connect to internet as it try to connect internet through Airport Express. So how to setup to use both.

    Thanks jakeloveslucy.
    I tried to setup the network by using Airport Utility, the problem is Airport Utility can not find Airport Express while I can use Airport Express to stream music very well. Can you suggest to fix this.
    I use windows 7 64 bit sp1 ; Airport Utility 5.6.1.
    [img]http://no4.upanh.com/b2.s29.d3/cc356ba2635bf1f46b71912fa1e6ce43_46991874.2012070 8133759.jpg[/img]
    [img]http://no6.upanh.com/b4.s29.d4/a0f5f05c0f2ec0f5e94b40bc7c8e2986_46991876.2012070 8135000.jpg[/img]

  • How To Use Connection Pooling in Struts.

    Can Somebody have the idea how to use connection pooling. i want to use jakarta commons dbcp, pool.
    using these packages how can i implement the connection pooling for my web application. If Anybody have some idea plz contect me.
    If Somebody have sample code plz send.
    Thks in Advance,

    Read the documentation...?

  • How to use Connection Pool on WLS 10.0 MP2?

    Hello there!
    I have a WS and i use ibatis to talk iwth a Oracle DB, but i have a requirement to use connection pool by wls and i dont where should i do this to my application.
    I just have this method to the connection
    private static void initDb() throws IOException, SQLException {
              log.info("Conectando a bd");
              String sqlMapResource = "com/app/activacion/db/sqlMapConfig.xml";
              Reader reader = Resources.getResourceAsReader(sqlMapResource);
              SqlMapClient sqlMapClientIbatis =
                   SqlMapClientBuilder.buildSqlMapClient(reader,properties);
              List<String> n = (List<String>) sqlMapClientIbatis.queryForList("test");
              log.debug("n: " + n);
              log.info("Conexion a BD realizada.");
    And my sqlMapConfig.xml is
    <sqlMapConfig>
         <settings cacheModelsEnabled="true"
              enhancementEnabled="true"
              lazyLoadingEnabled="true"
              maxRequests="320"
              maxSessions="128"
              maxTransactions="32"/>
         <transactionManager type="JDBC">
              <dataSource type="DBCP">
                   <property name="driverClassName" value="oracle.jdbc.OracleDriver" />
                   <property name="url" value="${db.connectionURL}" />
    <property name="username" value="${db.username}" />
    <property name="password" value="${db.password}" />
              </dataSource>
         </transactionManager>
         <sqlMap resource="com/epcs/facturacionpostpago/activacionbb/db/statements.xml" />
    </sqlMapConfig>
    Can u give me an advice to set the connection pool please?
    Thanx in advance!
    Edited by: mgaldames on 02-jun-2010 10:54

    According to a google hit, it looks like you should be able to do something like this:
    http://www.j2eegeek.com/blog/2005/01/31/ibatis-where-have-you-been-all-my-life/
    First, configure a datasource in the wls console, the example uses:
    jdbc/jpetstoreDS
    as the JNDI name.
    Then it looks like the following syntax works for the mapping that refers to that datasource, keep in mind your servername/port may be different.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd"?>
    <sqlmapconfig>
    <settings cacheModelsEnabled="false" enhancementEnabled=" true" lazyLoadingEnabled="true"
    maxRequests="32" maxSessions="100" maxTransactions="100" useStatementNamespaces="false"/>
    <transactionmanager type="JDBC">
    <datasource type="JNDI">
    <property name="context.java.naming.factory.initial" value="weblogic.jndi.WLInitialContextFactory"/>
    <property name="context.java.naming.provider.url" value="t3://localhost:7001"/>
    <property name="DataSource" value="jdbc/jpetstoreDS"/>
    </datasource>
    </transactionmanager>
    <sqlmap resource="com/j2eegeek/ibatis/dao/maps/Account.xml"/>
    </sqlmapconfig>

  • How do I setup and use Hawaiian fonts?

    How do I setup and use Hawaiian fonts in OSX 10.7.4?  The instructions I obtained by Googling no longer seem to work.  See Wahinoho.net
    Message was edited by: fbeckner

    How do I setup and use Hawaiian fonts in OSX 10.7.4?  The instructions I obtained by Googling no longer seem to work.  See Wahinoho.net
    Message was edited by: fbeckner

  • Using Connection Pooling in a WLS 5.1.x - Cluster

    Hi,
              We have problems using connection pooling in a WLS 5.1.x - Cluster. Is it
              possible to use CP in such a cluster at all ? The problem is, connections
              will be opened and never been closed. How can I configure a cluster for CP?
              I have a WLS-Cluster with 2 instances and my webApp uses connection pooling.
              By the way I get a connection on Instance 1, Instance 2 gets a connection
              also, but never releases it.
              In my opinion, the reference to the connection in the partner-instance will
              be lost.
              How do I have to configure my cluster to work well with that stuff ?
              Thank a lot,
              Markus.
              

    Clustering with connection pools works fine in WLS 5.1. If connections are
              not being release, you have bugs in your code.
              When a connection is retrieved from a pool on one instance, a corresponding
              connection is NOT retrieved on another instance.
              Mike
              "M. Hammer" <[email protected]> wrote in message
              news:[email protected]..
              > Hi,
              >
              > We have problems using connection pooling in a WLS 5.1.x - Cluster. Is it
              > possible to use CP in such a cluster at all ? The problem is, connections
              > will be opened and never been closed. How can I configure a cluster for
              CP?
              >
              > I have a WLS-Cluster with 2 instances and my webApp uses connection
              pooling.
              > By the way I get a connection on Instance 1, Instance 2 gets a connection
              > also, but never releases it.
              > In my opinion, the reference to the connection in the partner-instance
              will
              > be lost.
              > How do I have to configure my cluster to work well with that stuff ?
              >
              > Thank a lot,
              >
              > Markus.
              >
              >
              >
              

Maybe you are looking for

  • Reg Material get list...

    Hi all , Is there any BAPI or Function module to get the material data by passing the last change date. Regards, Krishnamoorthy.V.

  • Fios internet slow

    I'm paying for 25/25. I've run speed tests and at best I'm getting 10Mbps download and 5Mbps upload. I've changed channels rebooted router, verizon rebooted their equipment to no avail. Intermittently I've experienced timeouts on my wireless devices

  • Telnet Program Help

    I would like to write a program that does the following: 1. Telnet to a linux machine. 2. Execute an "ls" command. 3. Return the output of the "ls" command. 4. Parse the output for file names and display in a JTable. I found a sample program from the

  • "Macro" function like in Word?

    I cannot find the macro function (or whatever its called in Pages). I want to have a set of text, such as a return address, that I can call into a Pages document. Where does it live? Or what is it called so I can look it up in the manual? Thanks

  • PDS,PPM,supply chain model,production version in R/3

    Dear Guys, can some one help me to find the key difference between 1)PDS,PPM,Supply chain Model and production version in R/3 Thanks Raj