Need Help About Connection Pooling

I am new to WebLogic.
We have a Java based application hosted on WebLogic 6.1.
We have not used any Database Pooling utility.
We are just creating connection objects in JSP/Java files (Worst!!).
Now we want to use Database Connection Pooling facility of WebLogic.
So now if I create connection pool from WebLogic console, the database connection pooling will be automatically handle by WebLogic OR I have to develop a class using Database Pooling package of the WebLogic and than need to use that class in all file where I am accessing database.
Reg,
Chetan

Chetan,
Once you have created a connection pool using the console the next thing to do is create a datasource with a JNDIname that uses that pool.
Then you can write a ServiceLocator to use JNDI to encapsulate the lookup code and cache the datasource, finally and you can use the datasource to retrieve connections from your connection pool.
By creating a datasource you decouple your apoplication from connection pools making it more flexible. If you don't like ServiceLocators you can always use something like the spring framework to hide all the plumbing.
For some example code to connect to a datasource see:
http://e-docs.bea.com/wls/docs81/jdbc/programming.html#1056955
For a description of the service locator see:
http://java.sun.com/blueprints/corej2eepatterns/Patterns/ServiceLocator.html
And for completeness
http://www.springframework.org/
Cheers
Hussein Badakhchani
www.orbism.com

Similar Messages

  • Need Help on Connection pooling with asp

    Hi,
    I am need ur help on how i want set up the minimum and maximum connection for my asp programming.
    I am using Oracle 9i database with driver "Oracle in orahome 9.02.00.54".
    Ihave create the odbc to this driver for handle the connection pool.
    How i want to set the minimum and maximum connection ?
    This is my code:
    Set cn = Server.CreateObject("ADODB.Connection")
    cn. open "dsn=loadtest;uid=guardreg3;pwd=guardreg3;min pool size=15"
    I hope you all can help me.
    Thanks

    James,
    sometimes it makes sense to look at these things from a different (and broader) perspective.
    Especially in a context of a corporation it makes sense to use a Single Sign On (SSO) server for authentication (usually against LDAP) . Something like Netegrity Siteminder, Oracle SSO Server (as part of Oracle Internet Application Server) or something similar.
    Then you could have all your applications use the authentication method of the SSO server which will keep track of the valid session and the applications that participate in the SSO context.
    On the Apex side you would have to write a custom authentication scheme to leverage that functionality, the session handling will no longer be of any concern to you.
    Just a different way to look at it.
    ~Dietmar.

  • Need help about 1015

    need help about 1015 it says connect iphone to itunes on screen i did it but it doesnt work and says unexpected 1015

    Try restoring it: Make sure you are following the instructions in this procedure to the letter.  Here they are, with emphasis on some easily overlooked requirements:
    Disconnect the USB cable from the iPhone, but leave the other end of the cable connected to your computer's USB port.
    Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.If you cannot turn off the device using the slider, press and hold the Sleep/Wake and Home buttons at the same time. When the device turns off, release only the Sleep/Wake button.
    Continue pressing and holding the Home button while you reconnect the USB cable to the device. The device should turn on.
    Note: If you see the "low battery" screen, let the device charge for at least ten minutes to ensure that the battery has some charge, and then start with step 2 again.
    Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears (iTunes icon and USB connector) release the Home button.
    If necessary, open iTunes. You should see the "recovery mode" alert ("iTunes has detected a phone in recovery mode").
    Use iTunes to restore the device.
    If you do not see the "Connect to iTunes" screen, try these steps again.
    If you see the "Connect to iTunes" screen but the device does not appear in iTunes, see this article and its related links.
    If you have backed up the iPhone in the past, select the device in iTunes and choose "restore from backup".

  • Need help about Hidden Markov Model model

    I want to make classification for EEG signal using Hidden Markov Model
    algorithm based on neural network.
    plz need help about how to implement this algorithm using LABVIEW.
    if not I want another thing to make classification.
    any one know information about this topic, send me a reply
    thanks

    Have you derrived the HMM that you want to implement?
    If so, post the algorithm and we can provide comments on how to implement it using LabVIEW.
    Message Edited by Ray.R on 04-12-2010 12:54 PM

  • Need help about ref cursor using like table

    Hi Guys...
    I am devloping package function And i need help about cursor
    One of my function return sys_refcursor. And the return cursor need to be
    join another table in database . I don't have to fetch all rows in cursor
    All i need to join ref cursor and another table in sql clause
    like below
    select a.aa , b.cc form ( ref_cursor ) A, table B
    where A.dd = B.dd
    I appeciate it in advance

    My understanding is that you have a function that returns a refcursor and is called by a java app.
    Because this is a commonly used bit of code, you also want to reuse this cursor in other bits of sql and so you want to include it like table in a bit of sql and join that refcursor to other tables.
    It's not as easy as you might hope but you can probably achieve this with pipelined functions.
    Is it a direction that code should be going down? yes, eventually. I like the idea of pulling commonly used bits of code into a SQL statement especially into the WITH section, provided it could be used efficiently by the CBO.
    Is it worth the effort given what you have to do currently to implement it? possibly not.
    what else could you do? construct the sql statement independently of the thing that used it and reuse that sql statement rather than the refcursor it returns?
    Message was edited by:
    dombrooks

  • Need help about boot SUNFIRE V120

    Hi all....
    I need help about how to change boot from boot net to boot disk....
    after i installed sun solaris 10 at my sunfire v120, then reboot the machine ... this sunfire still boot from net not from disk...
    can i change it?
    please i really need help ....
    thanks

    If its booted, try "eeprom boot-device=disk"
    If your at the OBP, "setenv boot-device disk".
    If that doesnt work check the value of "diag-switch?".
    It could be booting off the the diag-device instead

  • Need Help about 3D and revolving in illustrator

    I really need help about 3D, Please tell me that How i create 3D in illustrator
    i want to revolve text or shape around any object like this, any plugin? or other software required for this?
    if somebody know this it will be really help full
       http://rcgrafix.fizwig.com/1452732-large.jpg    
       http://rcgrafix.fizwig.com/1384370-large.jpg
       http://rcgrafix.fizwig.com/1062180-large.jpg
    Thanks
    Arsi

    if links are not working try Copy and paste it in to your browser address bar
    thank you

  • Need help about the SHA Message Digest ? & what is use of Message Diagest ?

    need help about the SHA Message Digest ? & what is use of Message Diagest ?
    1>i have one program of making message digest
    2>which requires two files name
    3>one for input like txt
    4> second is out put file of message digest
    can any one tell what is the use of second generated file .

    MessageDigest md = MessageDigest.getInstance("SHA");
    FileInputStream fis = new FileInputStream(args[0]);
    byte[] b = new byte[1024];
    int readed = -1;
    while((readed = fis.read(b)) > 0)
         md.update(b, 0, readed);
    fis.close();
    FileOutputStream fos = new FileOutputStream(args[1]);
    byte[] d = md.digest();
    StringBuffer sb = new StringBuffer();
    for(int i = 0; i < d.length; i++) {
         String str = Integer.toHexString(d[i] & 0xff);
         sb.append(str.length() < 2 ? "0" + str : str);
    fos.write(sb.toString().getBytes());
    fos.close();

  • TS1398 I need help getting connected to our home wifi.

    I need help getting connected to our home wifi. I've reset network settings, iPhone, and router  but the error "unable to join network" keeps coming up. I also double checked the password. Please help

    Other possibilities:
    Your router firmware is out of date. Check the manufacturer's website for an update
    You have MAC (Media Access Control) filtering enabled on the router, that restricts access to "known" devices and the new iPhone is not on the table of known devices
    Your router has a setting limiting the number of simultaneous allowed devices
    Your routers SSID ("name") is still the default (e.g., LINKSYS, DLINK, NETGEAR, etc). Your phone has encountered other routers with the same name as you have traveled, and the phone is confused as to which router is the real one. If your router's name is still the default you should change it.

  • Need help to connect to aws instance from my macbook pro

    i need help to connect to an aws instance from my laptop. Please help me..

    No, it's not Apple's doing.
    You are infected with Downlite, which is preventing you from accessing the AdwareMedic site. For an explanation and some solutions, see:
    http://www.thesafemac.com/adware-blocking-adwaremedic-downloads/
    If the adware prevents you from loading that page as well, try this one:
    https://discussions.apple.com/docs/DOC-7792
    (Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com, in the form of buttons allowing for donations. Donations are not required to use my site or software.)

  • Hi, Need help about ios7 upgrade, after this upgrade I cannot watch youtube or any video with my Ipad,

    Hi, Need help about ios7 upgrade, after this upgrade I cannot watch youtube or any video with Ipad, and Iphone as well
    I think my wireless rooter's setting has some problem but cannot found anything to solve,
    I can watch if there is another wireless network , I tried this option in another place who has wireless network and I can watch.
    Do you have any idea to do these setting , I dont have any problem when Ipad has 6.1.3 IOS,
    need help
    thanks

    Thanks
    I will and share the result.

  • Need ACES attention - connection pooling in oracle 10g rel 1

    I am using TOMCAT 5.0.19 Webserver and ORACLE 10g REL 1 as the database server. I have to restart the TOMCAT Webserver in order to establish connection atleast twice or thrice in a weak. Why I am unable to see the connection pooling in oracle 10g rel 1. How to revive or establish the setup. My objective is to have a centralised oracle 10g rel 1 database server and the applications of java are run thru centralised Webserver Tomcat 5.0.19.
    Can anyone please help me out optimizing the design setup.
    Regards
    Vijay Kumar

    by putting 'Need ACES' in your post title, you might have actually reduced the number of people reading your post, in other words someone >who might have suggested Thanks John for your reply. I changed the subject of the thread after not getting any reply for past 10 days. Last two days I have been updating with plea for attention to my problem. Finally I thought pulling attention of ACES, then only I edited the subject.
    Now, problem I am facing is not in oracle database but in application server. Actually we are running web applications thru Tomcat accessing Oracle 10g rel 1. I am often losing connection with web server. The users are unable to login in the web application. I was told to check oracle database server. I just checked alert log and found no errors. I just asked them to shutdown and restart the web server Tomcat 5.0. It then worked fine. This is temporary. I need to ensure where the problem is. Could you please guide me in checking various parameters or files to be checked to optimise connection pooling.
    Regards
    Vijay Kumar

  • Can anyone tell me about Connection Pools???

    Hi,
    Is there a freely downloadable Connection Pool implementation available on the net? I need it specifically for Oracle databases... This is for a prod environment and am looking for a stable implementation... Any good information/links is most appreciated.
    Thanks
    Prowzen

    Hi,
    I actually implemented it long time back. This is a best case to implement the Singleton Pattern. Just to give an idea, here is how it goes. I'll try to post the code too but cannot guarantee it right now.
    Basically the Pool information like the database, userid, password, SID etc. should be configurable through a properties file as you are saying that it is a production environment.
    1. Implement your Connection Pool as a Singleton class that has methods like init, getConnection, releaseConnection, createConnection etc. Have private member - a java.util.Vector of java.sql.Connection objects.
    2. Anyone who wants to use the connection pool gets an instance with the getInstance method which will call init method.
    3. The init should read the properties file and get the necessary details. Then create required number of connections and put them in the Vector of connections (pool). You are good to go now. Ideally this should all be done at the startup of the whole Application.
    4. Each client will call the getConnection method of the Singleton. The getConnection should Synchronize the Vector and remove the connection at index 0 of the pool (vector) and return it.
    i.e. public java.sql.Connection getConnection ()
    //wait until someone notifies me after returning a connection back to the pool
    if(connectionPool_.size() == 0)
    wait();
    Connection con = null;
    synchronized(connectionPool_)
    con = (Connection)connectionPool_.elementAt(0);
    connectionPool_.removeElementAt(0);
    return con;
    5. Each client SHOULD call the releaseConnection method of the Singleton once it is done using the connection. The releaseConnection should Synchronize the Vector and add the connection back to the pool.
    So, basically the connections in the pool will be used in a Round-Robin Fashion.
    i.e. public void releaseConnection (java.util.Connection con)
    connectionPool_.addElement(con);
    //Notify all the waiting Clients. Let JVM decide who gets the connection.
    notifyAll();
    return con;
    This is the core logic of what I had written. But there are lot of other cases that you need to consider to write robust code like Lost Connections, when you need to throw that connection away from the pool and add a new one. This is more so significant in busy databases configured to timeout inactive connections. I used to have a low priority thread kicked off at the start along with this main pool that would wake up around 4 or 5 in the night and replenish all the connections in the pool so that it will be good to go for one more day before it gets replenished again. Of course, in such a case, the clients have to have a retry mechanism in case you don't respond in reasonable amount of time while replenishing the connection pool.
    Hope this helps.
    Amar.

  • Clarification needed on JDBC Connection Pool in  Clustered enviornment

    Hi All,
              Although I went through the bea online documentation , its not clear how
              JDBC connection pool works in clustered environment.
              If anyone can please answer following questions, it would be a great help.
              1) Do I need to create identical connection pools (with identical ACLs) on
              each WebLogic Server in the cluster ?
              2) Online documentation says " If you create an identical JDBC DataSource in
              each clustered WebLogic Server instance and configure those DataSources to
              use different connection pools, the cluster can support load balancing for
              JDBC connections. " what actually this means
              3) What's the use of "JDBC MultiPools " ? Is it same as "JDBC metapool "
              Thanks
              Regards
              Nalika
              

    See comments inline...
              Nalika wrote:
              > Hi All,
              >
              > Although I went through the bea online documentation , its not clear how
              > JDBC connection pool works in clustered environment.
              > If anyone can please answer following questions, it would be a great help.
              >
              > 1) Do I need to create identical connection pools (with identical ACLs) on
              > each WebLogic Server in the cluster ?
              I don't believe that it is strictly necessary to do this but it is certainly the
              most common configuration and probably the preferred one as well. WLS is smart
              enough to automatically use its Type 3 driver to route requests to a connection
              on another server but this type of server-to-server communication can have an
              impact on performance and scalability.
              > 2) Online documentation says " If you create an identical JDBC DataSource in
              > each clustered WebLogic Server instance and configure those DataSources to
              > use different connection pools, the cluster can support load balancing for
              > JDBC connections. " what actually this means
              Don't read too much into this. All that this is saying is that application
              components in each server will "prefer" to use their local DataSource (all other
              things being equal) and since other clustering technology (or things like
              hardware load balancers) are spreading the load across the servers, you will
              also spread the load across the different connection pools.
              > 3) What's the use of "JDBC MultiPools " ? Is it same as "JDBC metapool "
              Yes, these are one and the same.
              Hope this helps,
              Robert
              

  • Need help with connecting file inputs to arrays

    In this assignment I have a program that will do the following: display a list of names inputed by the user in reverse order, display any names that begin with M or m, and display any names with 5 or more letters. This is all done with arrays.
    That was the fun part. The next part requires me to take the names from a Notepad file, them through the arrays and then output them to a second Notepad file.
    Here is the original program: (view in full screen so that the code doesn't get jumbled)
    import java.io.*;       //Imports the Java library
    class progB                    //Defines class
        public static void main (String[] arguments) throws IOException
            BufferedReader keyboard;                                  //<-
            InputStreamReader reader;                                 //  Allows the program to
            reader = new InputStreamReader (System.in);               //  read the the keyboard
            keyboard = new BufferedReader (reader);                  //<-
            String name;                 //Assigns the name variable which will be parsed into...
            int newnames;               //...the integer variable for the amount of names.
            int order = 0;              //The integer variable that will be used to set the array size
            String[] array;             //Dynamic array (empty)
            System.out.println (" How many names do you want to input?");   //This will get the number that will later define the array
            name = keyboard.readLine ();
            newnames = Integer.parseInt (name);                                         // Converts the String into the Integer variable
            array = new String [newnames];                                               //This defines the size of the array
            DataInput Imp = new DataInputStream (System.in);       //Allows data to be input into the array
            String temp;                                       
            int length;                                                                  //Defines the length of the array for a loop later on
                for (order = 0 ; order < newnames ; order++)                                //<-
                {                                                                           //  Takes the inputed names and
                    System.out.println (" Please input name ");                            //  gives them a number according to
                    temp = keyboard.readLine ();                                           //  the order they were inputed in
                    array [order] = temp;                                                  //<-
                for (order = newnames - 1 ; order >= 0 ; order--)                                //<-
                {                                                                                //  Outputs the names in the reverse 
                    System.out.print (" \n ");                                                   //  order that they were inputed
                    System.out.println (" Name " + order + " is " + array [order]);             //<-
                for (order = 0 ; order < newnames ; order++)                                  //<-
                    if (array [order].startsWith ("M") || array [order].startsWith ("m"))     //  Finds and outputs any and all
                    {                                                                         //  names that begin with M or m
                        System.out.print (" \n ");                                            //
                        System.out.println (array [order] + (" starts with M or m"));         //
                    }                                                                         //<-
                for (order = 0 ; order < newnames ; order++)                                            //<-
                    length = array [order].length ();                                                   //
                    if (length >= 5)                                                                    //  Finds and outputs names
                    {                                                                                  //  with 5 or more letters
                        System.out.print (" \n ");                                                      //
                        System.out.println ("Name " + array [order] + " have 5 or more letters ");      //<-
    }The notepad file contains the following names:
    jim
    laruie
    tim
    timothy
    manny
    joseph
    matty
    amanda
    I have tried various methods but the one thing that really gets me is the fact that i can't find a way to connect the names to the arrays. Opening the file with FileInputStream is easy enough but using the names and then outputing them is quite hard. (unless i'm thinking too hard and there really is a simple method)

    By "connect", do you just mean you want to put the names into an array?
    array[0] = "jim"
    array[1] = "laruie"
    and so on?
    That shouldn't be difficult at all, provided you know how to open a file for reading, and how to read a line of text from it. You can just read the line of text, put it in the array position you want, until the file is exhausted. Then open a file for writing, loop through the array, and write a line.
    What part of all that do you need help with?

Maybe you are looking for

  • How can I pull from multiple output trays?

    I have a Xerox DP180. I have several paper types, example: white, blue, green. I want to be able to select different paper types from a multi-page PDF. Example: Pages 1 and 2 from tray 1 (white paper) Pages 3 - 10 from tray 2 (blue paper) Pages 11 an

  • Doc Uploaded by ABAP Class CL_SA_DOC_FACTORY= UPLOAD_DOC not visible

    I am uploading a document in Solution manager through the below code. CALL METHOD CL_SA_DOC_FACTORY=>UPLOAD_DOC   EXPORTING     I_DOC_TITLE              = 'TEST'     I_DOC_TECH_NAME          = 'TEST'     I_DOC_TYPE               = 'AD'     I_DOC_STAT

  • Problem with XML Deserialization Error

    Hi! when I test my webservice, I take the following error: Deserializing fails. Nested message: XML Deserialization Error. Result class com.sap.gram.SelRec.SelRec_CompGenModel does not have property of type java.lang.String. It is required to load XM

  • Generating WebHelp with RH 7

    When I update just a few topics in my RH 7 HTML projects, like with simple typo corrections, do I have to regenerate the entire WebHelp and re-publish all files?

  • Problem with unresponsiveness

    Right now, my Curve is totally unresponsive.  While the trackball will work on the home screen, none of the buttons register.  Every so often, random characters will appear (if it is on dialing screen).  It registers on the network, shows 2 messages