Connection pool utilization -  questions and problems.

Hi,
This is in context to JSP/Java/JPDK based web provider applcation. Appreciate it if anyone can add any input here -
1)After adding dbPersonalization to my JSP portlets I noticed that the connections in my connection pool have maxed out. After the first few page renderings, it breaks. I am not sure if its an inherent problem in my design. But, I do know that it started happening soon after I add the dbPersonalization with all its required setups as specified. Could that be possible ? Besides the connectionmanager.xml file required by the dbPersonalization setup, I also have my own connection properties file where I specify the min and max connections in the pool for all my java classes/methods to make use of. Is there a chance that the connection pooling information from both the files are clashing each other ??
2) On a related topic - I wanted to get some input on a design question. I have about 10 JSP Portlets on each of the four tabs of my Portal page, with each one instantiating one class (useBean) that contain methods to get data from the database. Now every single method of each of these classes, gets and puts a connection object from the pool.
The question is if the frequency of getting a conn object in every method of every JSP portlet too expensive ? Would it be better to make use of one connection object common to all the methods in a class/JSP/portlet ?
I had set the min to 6 and the max conns to 25 and it looks like very soon all 25 gets used, which wasnt happening before I added the dbPersonalization setup to my portlets. The dbPersonalizaiton is only for editDefaults though.
regards
-Ananth Makaram

Ryan,
as to your 7.2.1 problem: MANY people had that same issue and did revert to
7.1.1 (I did the same after being unable to connect once I upgrade) So no
worries - your AEBS is fine as it is working with 7.1.1
For the second part, I am not a wifi guy, but check out the article on
http://www.bbwexchange.com/pubs/2006/09/20/page1397-228167.asp
maybe that will give you some idea about WiFi 2.0 and if you benefit from it!
Joerg

Similar Messages

  • A way to find my previous questions and problem reports?

    Is there a way on this forum to find my previous questions and problem reports? Since posting a question earlier today, I've found MOST of the answer and would therefore like to append what I found to the question, without waiting for someone else to answer it. I don't remember the title I gave the earlier question, or I'd use that title in searching for it.
    The troubleshooting information below is more relevant to a previous problem than this question.

    '''My Contributions''' link on a main forum page should display a listing of all your postings.
    [https://support.mozilla.com/en-US/search?q=&num_voted=0&num_votes=&asked_by=milesrf&answered_by=&q_tags=&created=0&created_date=&updated=0&updated_date=&sortby=0&a=1&w=2 See this forum search for your Username under "Asked by"]

  • Startup problems with XA connection pools on Oracle and WLS 6.1

    I am having starup problems trying to set up a WLS 6.1 connection pool using
    XA. When I try to start the server, I get the following exception:
    <Nov 19, 2001 3:06:28 PM EST> <Error> <JDBC> <Cannot startup connection pool
    "dbdev1XAPool" weblogic.common.ResourceException: java.sql.SQLException:
    open failed for XAResource 'dbdev1' with error XAER_RMERR : A resource
    manager error has occured in the transaction branch. Check Oracle XA trace
    file(s) (if any) for database errors. The Oracle XA trace file(s) are
    located at the directory where yo
    u start the Weblogic Server, and have names like
    xa_<pool_name><MMDDYYYY>.trc.
    at weblogic.jdbc.oci.xa.XAConnection.<init>(XAConnection.java:58)
    at
    weblogic.jdbc.oci.xa.XADataSource.getXAConnection(XADataSource.java:600)
    at
    weblogic.jdbc.common.internal.XAConnectionEnvFactory.makeConnection(XAConnec
    tionEnvFactory.java:194)
    at
    weblogic.jdbc.common.internal.XAConnectionEnvFactory.createResource(XAConnec
    tionEnvFactory.java:54)
    at
    weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllocator.j
    ava:698)
    at
    weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.java:282
    at
    weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.java:620
    at
    weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
    at
    weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentT
    arget.java:329)
    The contents of the Oracle trace file:
    ORACLE XA: Version 8.1.7.0.0. RM name = 'Oracle_XA'.
    150627.1312:344.344.330727191:
    xaoopen:
    xa_info=Oracle_XA+Acc=P/cmauser/admin+SesTm=100+DB=dbdev1+Threads=true+LogDi
    r=.+DbgFl=0x15,rmid=330727191,flags=0x0
    150627.1312:344.344.330727191:
    ORA-12560: TNS:protocol adapter error
    150627.1312:344.344.330727191:
    xaolgn_help: XAER_RMERR; OCIServerAttach failed. ORA-12560.
    150627.1312:344.344.330727191:
    xaoopen: return -3
    I am running WLS 6.1 and Oracle 8.1.7 on windows (separate machines). The
    connection pool settings are:
    <JDBCConnectionPool CapacityIncrement="0"
    DriverName="weblogic.jdbc.oci.xa.XADataSource" InitialCapacity="40"
    MaxCapacity="40" Name="dbdev1XAPool"
    Properties="user=cmauser;password=admin;dataSourceName=dbdev1"
    RefreshMinutes="15" ShrinkingEnabled="false" SupportsLocalTransaction="true"
    Targets="cmatest" TestTableName="hppcontentsource" />
    I have not had any problems connecting to the same database through regular
    JDBC connection pools or through the utils.dbping utility.
    What am I doing wrong?

    This is a dup message. Add "DebugConfigInfo OFF" in httpd.conf.
    Jong
    [email protected] (Olaf Foellinger) wrote:
    >
    Hi,
    we're trying to setup apache on linux so that it's forwarding all jsp
    requests to Bea WLS 6.0 on Solaris. We've installed the mod_wl.so
    modules according to the documentation. When apache starts it shows the
    following warning:
    [Tue Jan  9 13:22:55 2001] [warn] Loaded DSO
    /usr/lib/apache/1.3/mod_wl.so uses plain Apache 1.3 +API, this module
    might crash under EAPI! (please recompile it with -DEAPI)
    and in fact, when we try to load a jsp page we get
    [Tue Jan  9 13:29:14 2001] [notice] child pid 5780 exit signal
    Segmentation fault (11)
    Does anyone have a working solution ? Can bea provide us with a plugin
    compiled with EAPI ?
    Greetings Olaf

  • JDBC Connection Pool to DB2 database - Problem

    When trying to create a new JDBC Connection Pool in WebLogic using BEA Type 4 driver
    for DB2, I get the following error:
    [BEA][DB2 JDBC Driver]A commitment command has been received on a protected conversation.
    The commit and rollback commands are not allowed on protected conversations.
    DB2 v8.1 Enterprise Edition on Sun Solaris v8
    WebLogic 8.1 SP2 on Windows 2000/XP
    Please help!

    Sorry forgot to add the exception, this is the exception,
    java.sql.SQLException: RSR0029: Missing Password for Application Authorization
    Any idea as when we get this exception?

  • Two Issues: Connectivity through a PC and problems with Airport Extreme

    Hello, I am fairly new to the Mac universe and not TOO knowledgeable about computers in general, so here I am asking you two questions that may appear simple or even lazy to some of you. Excuse me for that.
    I just bought this Macbook yesterday, and the the wireless connection was working alright. Today, I can't get online trough browsers and other programs, even when Airport says it is perfectly connected, with no problems whatsoever. I've alredy checked, re-checked and reconfigured all there was to it and nothing happens anyway. I have noticed this problem is pretty frequent from up to Mac OS X version 10.5.2, and I see a lot of inquiries from other members but no universal resolution from either the community or Apple themselves.
    If anyone can indicate me the way to a patch I haven't stumbled, or the most functioning solutions from other users I would be very thankful!
    The other issue I have is that since I have this problem, I would like to know how can I connect to the internet using a PC laptop's wireless connectivity. Down where I live, I receive a free wireless connection to my PC, from which no password is required and no problems are perceived. What (software, hardware, cables) do I need, and how can I make it so I could freely browse the web with my Macbook using the PC's connectivity?
    Thanks for all your time reading and helping me to break this problem. Connecting to the internet is fundamental for me at this moment, so I appreciate all your help. BYE.
    Message was edited by: Kutch'a

    Hi marielouise -
    Greetings and welcome to the Apple boards.
    Does this help: Networking with a Windows PC?
    Luck-
    -DaddyPaycheck

  • A few Technical questions, and problem with entitlements

    Hello everyone,
      I always hate my first post being a question, or several in this case, but I have no other option and wouldn't have found this forum if it weren't for the knowledge already spread.
    Background...
    Using Windows Vista and Flash CS5;
    I am using a second gen ipod touch;
    Made a small Ball app;
    Used the following videos followed to the "T" to make a Certificate, .p12 file, and provisioning file
    certificate...
    http://www.videomo.com/yvideo.php?i=bXB6U1hBcWuRpVzBxVUk&create-an-iphone-developer-certif cate-from-windows/
    .p12 file...
    http://www.youtube.com/watch?v=4GteMgFvA1Y
    provisioning profile...
    http://www.youtube.com/watch?v=ni-9jZPcZ1E&feature=related
    To the best of my knowledge everything is setup in portal the right way... and i mean:  Device is added, checked udid several times and device name is same...bundle ID is correct in publishing settings...I used my NAME (was a problem for some people) for CN when doing the above... I have dragged the profile to the library in itunes and synced. I have UPDATED my iphone to the 3.whatever platform, and updated itunes to 9.X ...I have dragged everything to library and synced...i have restarted ipod and comp several times...
    i have tried publishing as test, beta debugging, and adhoc...no luck with any of them.
    At first, i had a "app cannot be installed because the signer is not valid" error when syncing the app through itunes...but then i dragged provision profile to ipod and I now get...
    "The application "Ball" was not installed on the iPod "Wiggles" because the entitlements are not valid."
    I spent all night last night trying to diagnose this problem, found very little info, someone else posted here, but it was never resolved.
    I have checked again and again that the device is the right device, and i have remade my certs, provisioning profiles...p12s....exports, publications...etc....again and again.
    Please help!
    SECOND question:  Am I not going to be able to release any apps in the iphone store because of the apple not supporting flash thing? (basically, i'm asking if i should stop learning this, altogether and just learn a different language and platform for development for iphone.
    I do not own a mac, so I am trying to work around that.....
    Any advise is appreciated! Thanks !
    thank you...
    kmrproduction2

    How did you solved, I have tried everything nothing works.  My app id is 83TUF2RQRE.com.company_name.appstest, the screen from apple iOS Provisioning Portal -> App ID looks like this.....
    Descriptions
    Apple Push Notification service
    In App Purchase
    83TUF2RQRE.com.company_name.appstest
    testapp
    Configurable for Development
    Configurable for Production
    Enabled
    I don´t know how to use it...... I'm working on WIN7 Flash CS5, I got an Ipad where i have to test a really simple app, and i cannot get installed cause of "entitlements issue". Ca Some one give a Hand on this one....
    Thanks.....

  • Questions and problems with CS4

    Hi, I'm trying out CS4.  I have some problems and questions I hope someone can answer.  I only care about the code editing part.
    1) My "Open Recent" menu in the File menu is always empty.  I've opened all kinds of files over the past few days and it never updates/adds to that list.  its always empty.  When is this suppose to update?
    2) When I edit .inc files they're not color coded.  How can I tell Dreamweaver to color code .inc files too? It doesn't matter which color code (.HTML, .PHP, etc.) it uses.
    3) Whats the best way to change the color setup for a given file like .HTML?  Edit some Dreamweaver .xml file or in the preferences somewhere?  Or another way?  is it possble to essentially create a custom color combination and apply it to HTML files?
    4) How can I get rid of "Share My Screen" in the file menu?  When I hit ALT-F, then S - I would like it to save the file out of habit.  All I get is a share my screen now.  Not sure what genious organized that but its kind of a stupid place to put it.
    I'm under Windows 7 64bit. Dreamweaver version 10.0 Build 4117.
    thanks for any help.

    You can edit color coding in >edit>preferences (ctrl-u)...
    ...and whilst you are there you can select in the general tab to open the files you had open in your last session.
    I don't konw why the list of files isn't populated and I don't know about .inc files.
    Instead of using >ctrl-f >s why not go for ctrl-s or shift-ctrl-s?
    Martin

  • Questions and problems with 7.2.1

    I updated to 7.2.1 when it first came out. However, I have noticed that I've been loosing my connection frequently, about once every couple of days. (I was gone for a honeymoon most of the time however). I would be working fine, then all of a sudden, I'd loose connection to my disk, the web, and even to the router itself. Meaning, I'd go into airport utility and it cant find the router, even though I'm connected to it.
    I downgraded back to 7.1.1 and all seems to be better.
    Has anyone else noticed this with 7.2.1? I hope so, or else my router is failing...
    ALSO, what does it mean by saying that 7.2.1 is "wifi 2.0 certified"? Are there any improvements in 7.2.1 that are not in 7.1.1? Thanks.
    Ryan
    Message was edited by: rpeters83

    Ryan,
    as to your 7.2.1 problem: MANY people had that same issue and did revert to
    7.1.1 (I did the same after being unable to connect once I upgrade) So no
    worries - your AEBS is fine as it is working with 7.1.1
    For the second part, I am not a wifi guy, but check out the article on
    http://www.bbwexchange.com/pubs/2006/09/20/page1397-228167.asp
    maybe that will give you some idea about WiFi 2.0 and if you benefit from it!
    Joerg

  • Apex 3.1. Interactive Report. Questions and Problems.

    Hello!
    First of all I'd like to say Interactive Report is a really really brilliant feature, it covers exactly that points which we were missing in previous releases of Apex. Only this single feature makes Apex 3.1 release most significant for us since may be HTML DB 1.6. So much much thanks!
    So I have some questions about Interactive Report (IR):
    1) About "Save Report" feature. It is possible there to save own version of report layout or overwright the default settings. There is also possibility to completelly disable this function. So the question is it possible to disable only the ability to overwright the default report but give the ability to save own reports. It would be reasonable since too smart or too dum users can break the default layout of report and break the work for other users which don't use this function at all. At the same time the possibility to save own reports
    is absolutelly perfect
    2) Search. I'm from Germany and we have some national non-english symbols. The IR can't perform seach correctly if we use words with such symbols. Example word "Bestätigt" is interpreted by IR as "Bestätigt". At the same time the words are correctly displayed in reports and in interface. We have correct NLS_LANG, we have imported the lang_de.sql , and our own self-made search on simple reports works ok. What's to do?
    3) Charts in IR. Is there some data volume limits for Chart in IR ? sometimes we get the message "Loading XML...100%" during chart rendering and then happens nothing. In log file of Apache there is no any error messages...
    Thanks in advance,
    Alex

    Hi Alex,
    Glad to hear you're putting interactive reports to use, we put in a lot of time trying to get them right (at least for their first release).
    1) The "Save As Default Report Settings" option is only available for Developers, so you can only see it if you already see the developer toolbar at the bottom of the page. Standard end-users can't see this, so they can't save over your default report settings.
    2) That's right, the character set of the DAD needs to be AL32UTF8.
    3) A maximum of 1000 chart points will be returned, but you should not get this error. Can you describe the columns you are charting and the chart settings?
    - Marco
    Message was edited by:
    MAdelfio

  • Good  day! My question and problem is, it's not secured to to download an apps because my account was hacked when I signed to Dropbox yesterday in my purchased- AlwaysOnPC Xform computing, and he/she got to me a .99$ on fb upload unlimited?

    What can we do with this thing? There is any the best solution for this, cause me as a iPad user something can discouraging for my side to another iPad, or apps for my iPad. I have a plan now to buy a new generation ipa3 or even MacBook, and starting to earn and budgeting to by that thing. Right? Please give me some ad vice if not to buy any apps if there is any one apps that fits all, rather than to buy any that can cause failure to me. That apps is Dropbox so I trash it, and the comment is UNTRUSTED apps, I change my ID &amp; password I really don't know if the future they will continue hacking so first, they got to me 99$. But the question is? If what will do next? That hackers is from the u.s. please bear with us. Thank you!

    I use drop box, remote desktop and other things, the secret is to create complex passwords and also make passwords different for each login. so if you had a password on itunes say 1tUnes##  do not use this anywhere else.
    so you might have dr0pB0x/2 or w1bbL3*
    make sure all passwords have numbers letters uppercase and strange characters that will make them more secure.
    even more secure is non word selections like say   r4Y9L1?e9##
    your account security drops whenever you use the same password anywhere else.

  • Some question and problems on FSB:Dram

    Hi to all, i have a simple question fo you (i hope that's simple :D )
    I have a p4 3.2 GHz like you can see here:
    FSB is 200Mhz and it's ok
    But i have 4 pc3200 ram modules in dual channel mode, i think that their frequency must be 200Mhz but it's only 160, and i can't activate pat, like yuo can see here:
    Now my question is: Why?
    Thank to all

    Quote
    Originally posted by NovJoe
    Simple, as displayed in the second picture, you've set your DRAM Frequency to DDR 333MHz which will be detected as 320MHz for FSb 800MHz CPU on DDR 400MHz RAMs. Due to this, CPU-Z will think that you are running in 5:4 ratio instead of 1:1 ratio. To obtain 1:1 ratio, you must set your DRAM Frequency to 400MHz in BIOS and make sure that DDR Clock is reading it at 400MHz also before saving to CMOS. Check with CPU-Z again and you'll see that it'll display 200MHz(RAMs are double rated where you've to multiply the rates by 2) and ratio at 1:1.
    Isn't so easy...
    My actual configuration:
    Dynamic Overclocking: Private
    Performance Mode: Slow (If i put fast or greater... KABOOM :D)
    CPU Ratio: Locked
    DRAM Frequency: 400Mhz
    Spread Spectrum: Disabled
    Adjust CPU Bus Clock(Mhz): 200
    DDR Clock: 333 (Adjust AGP/PCI Clock (Mhz): 66.66/33.33
    CPU Vcore Adjust: NO
    CPU Vcore: 1.5500V
    DDR Power Voltage: 2.65V
    AGP Power Voltage: 1.55V
    I can't understend why DDR Clock is 333 :(

  • In regards to every PayPal question and problem. You will not be able to switch your billing preference to PayPal unless you do it on a COMPUTER. It will never work, EVER, on an iPad. I state this from personal experience. Apparently no one in Support kno

    I found out the hard way that you have to be on a computer to change your payment preference to PayPal. Period. The option for PayPal does not even show up on an iPad. Apparently ITunes support does not know this or they would let everyone know. Go on your computer. Open account. Type in your password. Then click on edit payment type. Only on a computer do you have an option of choosing PayPal. I really hope this helps someone :)
    Judi

    Thank you! I put some self help hypnosis tracks to listen to on my iPod. I did not want to go to the next track automatically, I wanted to listen to them individually, one at a time. (If I fell asleep, I did not want to 'wake up' in the middle of a different track.) Your information helps me understand that I need to re-load this playlist onto my iPod from my  Mac computer, only first, I need to UNCHECK the boxes in front of each track so the iPod will STOP each time after playing the selected track. It is too bad that so many functions are not availabvle within the iPod, but that is probably why they can make it so compact.

  • Problem with JNDI/LDAP AND connection pool

    I'm a newbie to Java but am attempting to write a servlet that retrieves info use to populate the contents of drop down menus. I'd like to only have to do this once. The servlet also retrieves other data (e.g. user profile info, etc ...). I'd like to be able to use the connection pool for all of these operations but I'm getting a compile error:
    public class WhitePages extends HttpServlet {
    ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
    public static String m_servletPath = null;
    public static String cattrs = null;
    public static String guidesearchlist[] = {};
    public static int isLocalAddr = 0;
    private int aeCtr;
    private String[] sgDNArray;
    private HashMap sgDN2DNLabel = new HashMap();
    private HashMap sgDN2SearchGuide = new HashMap();
    private String strport;
    private int ldapport;
    private String ldaphost;
    private String ldapbinddn;
    private String ldapbindpw;
    private String ldapbasedn;
    private int maxsearchcontainers;
    private int maxsearchkeys;
    private String guidesearchbases;
    private String guidecontainerclass;
    private String strlocaladdr;
    private String providerurl;
    // my init method establishes the connection
    // pool and then retrieve menu data
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    String strport = config.getInitParameter("ldapport");
    ldapport = Integer.parseInt(strport);
    String strconts = config.getInitParameter("maxsearchcontainers");
    maxsearchcontainers = Integer.parseInt(strconts);
    String strkeys = config.getInitParameter("maxsearchkeys");
    maxsearchkeys = Integer.parseInt(strkeys);
    ldaphost = config.getInitParameter("ldaphost");
    ldapbinddn = config.getInitParameter("ldapbinddn");
    ldapbindpw = config.getInitParameter("ldapbindpw");
    ldapbasedn = config.getInitParameter("ldapbasedn");
    guidesearchbases = config.getInitParameter("guidesearchbases");
    guidecontainerclass = config.getInitParameter("guidecontainerclass");
    strlocaladdr = config.getInitParameter("localaddrs");
    providerurl = "ldap://" + ldaphost + ":" + ldapport;
    /* Set up environment for creating initial context */
    Hashtable env = new Hashtable(11);
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, providerurl.toString());
    /* Enable connection pooling */
    env.put("com.sun.jndi.ldap.connect.pool", "true");
    StringTokenizer st = new StringTokenizer(guidesearchbases, ":" );
    String guidesearchlist[] = new String[st.countTokens()];
    for ( int i = 0; i < guidesearchlist.length; i++ ) {
    guidesearchlist[i] = st.nextToken();
    // Get a connection from the connection pool
    // and retrieve the searchguides
    StringBuffer asm = new StringBuffer(""); // This is the advanced search menu htmlobject buffer
    StringBuffer strtmpbuf = new StringBuffer(""); // This is the simple search menu htmlobject buffer
    try {
    StringBuffer filter = new StringBuffer("");
    filter.append("(objectclass=" + guidecontainerclass + ")");
    String[] attrList = {"dn","cn","searchguide"};
    SearchControls ctls = new SearchControls();
    ctls.setReturningAttributes(attrList);
    ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    String attrlabelkey;
    sgDNArray = new String[guidesearchlist.length];
    for( int i = 0; i < guidesearchlist.length; i++ ) {
    // Search each of the namingspaces where
    // searchguides exist then build
    // the dynamic menus from the result
    DirContext ctx = new InitialDirContext(env);
    NamingEnumeration results = ctx.search(guidesearchlist, filter, ctls);
    I get a compile error:
    WhitePages.java:164: cannot resolve symbol
    symbol : method search (java.lang.String,java.lang.StringBuffer,javax.naming.directory.SearchControls)
    location: interface javax.naming.directory.DirContext
    NamingEnumeration results = ctx.search(guidesearchlist[i], filter, ctls);
    ^
    WhitePages.java:225: cannot resolve symbol
    symbol : variable ctx
    location: class OpenDirectory
    ctx.close();
    ^
    Can anyone help? If there is someone out there with JNDI connection pool experience I would appreciate your assistance!

    Manish
    The issue may not be related to the number of connections or the initial
    connections. Check your heap size (ms, mx). Turn on verbosegc. Your heap may
    not be big enough to accept the 25,000 rows.
    Bernie
    "Manish Kumar Singh" <[email protected]> wrote in message
    news:3e6c34ca$[email protected]..
    We are creating the result set with 25000 rows(each row has 56 columns) bygetting the connection using data source. With the initial capacity of the
    connection pool is 5 and the max capacity as 30 and grow connection as 1,
    the server gets out of memory exception, when we issue a new request, even
    after closing the previous connections.
    Now, if we change the initial capacity to 1 and rest all the things assame, the issue gets resolved and the server works fine.
    Could you please help me out in this regard????
    thanks in advance
    manish

  • Questions regarding Connection Pooling

    Hi
    i have some confusion regarding how connection pooling is implemented..i have been doing some digging in to this lately but the more i read the more confused i get. i have some doubts here, will any of the posters here kindly clear them
    a. Do i have to connect to my database via the DataSource method to take advantage of the connection pooling provided by my app server?..i have read conflicting information about this suggesting that Connection Pooling will not be provided to my app if i use DriverManager.getConnection()
    b. if i chose to use the DataSource method do i have to implement the ConnectionPoolDataSource interface to provide the connection pooling for my app?
    c. what is the best way to implement my own custom Connection pool?
    Thanx

    DriverManager.getConnection() literally creates, that is, builds a connection to the database using the values you previously supplied when you loaded the driver.
    A connection pool is an object that contains several already made connections to the database, and simply provides you with one of those existing connections. The confusion arises because a) the method name is frequently the same and b) the connection pool object calls the driver's getConnection() method to create several connections before lending any of them out.
    In other words:
    DriverManager.getConnection() builds a connection to the database.
    ConnectionPool.getConnection() fetches an existing connection.
    So, to answer your questions...
    A. This is correct. If you use DriverManager.getConnection(), you are indeed bypassing the Connection Pool entirely.
    B. I'm not familiar with DataSource specifically, but in general, a third party connection pool will either give you the interface (and you implement the details) or they will give you the class file containing the DataSource object. All you would have to do in the latter case is to import that file, then create a new instance of it using the new keyword ( DataSource foo = new DataSource(); ). I suspect DataSource is indeed the class file.
    C. Creating a connection pool is trivial and there are many examples of it - search on this forum or check out your favorite Java/JDBC programming book. Usually, the question "Should I use a connection pool and why?" is a more important question.

  • MySQL connection pooling (tomcat) problem

    Hi all i just started learning servlets and i want to make a program in order to understand database connection pooling in tomcat.My problem is that when i run the servlet i created i get this error :
    java.lang.NullPointerException org.DB.TestDB2.doGet(TestDB2.java:105) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    And that from tomcat log from netbeans :
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' 
    .I configured tomcat server.xml file like this :
    <Context path="/DBTest" docBase="DBTest"         debug="5" reloadable="true" crossContext="true">   <Resource name="jdbc/phonebook_db" auth="Container" type="javax.sql.DataSource"               maxActive="100" maxIdle="30" maxWait="10000"               username="*******" password="********" removeAbandoned="true"               removeAbandonedTimeout="120" driverClassName="com.mysql.jdbc.Driver"               url="jdbc:mysql://localhost:3306/test_phonebook_db?autoReconnect=true"/> </Context>   
    This is the resource reference i have in my web app web.xml file :
    <resource-ref>       <description>DB Connection</description>       <res-ref-name>jdbc/phonebook_db</res-ref-name>       <res-type>javax.sql.DataSource</res-type>       <res-auth>Container</res-auth>   </resource-ref> 
    And this is my servlet class :
    package org.DB;  import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.sql.*; import javax.naming.*; import javax.sql.*; public class TestDB2 extends HttpServlet { private Connection conn ; private Statement stat ; private ResultSet rs ; private int counter; private Object rsValue; public void init() {     try {             InitialContext ctx = new InitialContext();             DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/phonebook_db");             conn = ds.getConnection();             }         catch(Exception e) {               e.printStackTrace();         }     }     public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {         try {           stat = conn.createStatement();           rs = stat.executeQuery("SELECT * FROM phones_table");            } catch (SQLException sqle) {         sqle.printStackTrace();         }      response.setContentType("text/html; charset=utf-8");     PrintWriter out = response.getWriter();         String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + "Transitional//EN\">\n";     out.println(docType +"<HTML>\n" + "<HEAD><TITLE>PhoneBook entries</TITLE></HEAD>\n");         counter = 0;     try {         while (rs.next()) {             out.println("<h4>Entry no. " + (++counter) + "</h4>");             out.println("<table width=\"75%\" border=\"1\">");             out.println("<tr>\n"+ "<td width=\21%\"><b>LastName:</b></td>\n"+ "<td width=\"79%\">");             out.println((((rsValue = rs.getObject("LASTNAME"))==null || rs.wasNull())?                 "":(rsValue.toString())));             out.println("</td>\n</tr>\n" +  "<tr>\n"+                     "<td width=\21%\"><b>FirstName:</b></td>\n"+ "<td width=\"79%\">");             out.println((((rsValue = rs.getObject("FIRSTNAME"))==null || rs.wasNull())?                 "":(rsValue.toString())));             out.println("</td>\n"+ "</tr>\n"+                     "<td width=\21%\"><b>Phone:</b></td>\n"+ "<td width=\"79%\">");             out.println((((rsValue = rs.getObject("PHONE"))==null || rs.wasNull())?                 "":(rsValue.toString())));             out.println("</td>\n" + "</tr>\n" +                     "</table>\n"+ "<br>\n<br>");         }     } catch (SQLException sqle) {         sqle.printStackTrace();     }     out.println("</body>\n"+             "</html>"); } public void destroy() {     try {         rs.close();         stat.close();         conn.close();     } catch (SQLException sqle) {         sqle.printStackTrace();         }     } }{code} Any suggestions?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thank you for your answer.Yes my servlet class is something more worse than horrible(i don't use the database connection correct i don't use the MVC pattern i use out.println() ) but i just tried to take a ready example and try to understand .So i write this servlet myself as a starting point :
    package org.DB;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.*;
    import java.sql.*;
    public class DBServlet extends HttpServlet {
        private Connection conn ;
        private Statement stat ;
        private ResultSet rs ;
        private int counter;
        String driver = "com.mysql.jdbc.Driver";
        String dbURL = "jdbc:mysql://localhost:3306/phonebookdb?user=**********&password=************";
        @Override
    public void init() {
         try {
                Class.forName(driver).newInstance();
                conn = DriverManager.getConnection(dbURL);
         }catch(Exception e) {
                  e.printStackTrace();
                  System.err.print("Unable to make connection ");
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {
                out.println("<html>");
                out.println("<head>");
                out.println("<title>Servlet DBServlet</title>"); 
                out.println("</head>");
                out.println("<body>");
                out.println("<h1>Servlet DBServlet at " + request.getContextPath () + "</h1>");
                out.println("<br /><br /><br />");
                if(conn!=null) 
                    out.println("conn object : "+conn);
                out.println("</body>");
                out.println("</html>");
            } catch(Exception sq) {
                System.out.println("Exception" + sq.getMessage());
                out.close();
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
         public void destroy() {
         try {
             conn.close();
         } catch (SQLException sqle) {
             sqle.printStackTrace();
        @Override
        public String getServletInfo() {
            return "A Simple Servlet";
    }And it work for now.
    Edited by: pavlos555 on Oct 21, 2008 10:21 AM

Maybe you are looking for

  • Connecting an LG monitor to a macbook pro

    I have the correct adapter and when first plugged it in, the display on my laptop showed on the monitor, but not the entire image.  Now I only see my desktop background with no icons and nothing shows on the monitor that I'm working on.  Also, the to

  • 3D Animation in CS4 problem or normal?

    I'm just wondering if animating a 3D object in PS CS4 is exceptionally slow or if I'm doing something wrong... Win7 Pro, 6-core 980X, 24G RAM...Production Premium CS4. I shut off all the Aero stuff before I opened Photoshop. I took a relatively small

  • How to enforce order of execution of parallel tasks?

    How do I set the order of execution of parallel tasks in a container? The execution isn't truly random. It appears to be set to a random constant at package creation. Demo I set up a dummy package. Max concurrent executions = 1 sequence container wit

  • Can I uninstall version 9 and put back version 8 ?

    I upgraded to version 9 of itunes but I don't like it, I liked the old show by genre on home page instead of the new itunes peddling particular artist and albums. Can I uninstall version 9 and put back version 8 ? does this matter to my iphone ?

  • AIR unknown publisher..

    Check this pic. anyone know hwo to replace UNKNOWN" with my name? I check ***-app.xml ,but cant find how to change. and alose the system access. thanks