How can i use the connection pool in JDBC2.0

Thanks

Hi,
You can use DbConnection broker which directly returns connection to DB
Try http://www.javaexchange.com/
In that you can specify max and min pool connection pool size
see example below:
DbConnectionBroker dbBroker = new DbConnectionBroker(strDBDriver, strDBURL,strDBUser, strDBPassword, iMinPoolSize,     iMaxPoolSize, strLogFile, dblTimeInMillisBetResets);

Similar Messages

  • How can I use the Connection Pool with DB2

    Hi All,
    I am facing the problem with the usage for the Connection Pool.
    I want to use DB2 via JNDI lookup.
    But when starting the Weblogic server, Error occured with the following message.
    <Error> <JDBC> <Cannot startup connection pool "MyJDBCPool" Cannot load driver class : com.ibm.db2.jdbc.app.DB2Driver>
    DB2 and Weblogic are on the same machine.
    In case of the use of remote DB2 database, I also encountered the same error.
    Configurations are as follows.
    <JDBCConnectionPool DriverName="com.ibm.db2.jdbc.app.DB2Driver"
    MaxCapacity="10" Name="MyJDBCPool"
    Password="{3DES}gCGsOfD9M6iwOtgL2v/NpA==" Targets="myserver"
    TestConnectionsOnReserve="false" TestTableName="test" URL="jdbc:db2://localhost:6789/yongjoo"/>
    <SNMPAgent Name="mydomain"/>
    <JDBCDataSource JNDIName="acsdb" Name="acsdb" PoolName="MyJDBCPool" Targets="myserver"/>
    Could you please give some information about this problem? I will appreciate your kindness.

    Hi Joe,
    Thanks your help.
    Perhaps It's my fault for Weblogic console's setting.
    After I reset the target server in console, Error message disappeared.
    But, when I call the TestCode, I encountered another error message. The error
    is NameNotFoundException.
    When lookingup the JNDI name, NameNotFoundException errer occured. I tried to
    change my setting and JNDI name, but the results are the same.
    Would you please give me some information about this one more time? I will be
    appreciated for your help.
    Follows are Config.xml
    <JDBCConnectionPool DriverName="com.ibm.db2.jdbc.app.DB2Driver" MaxCapacity="10"
    Name="MyJDBCPool" Password="{3DES}gCGsOfD9M6iwOtgL2v/NpA==" Targets="myserver"
    TestConnectionsOnReserve="false" TestTableName="test"
    URL="jdbc:db2://localhost:6789/yongjoo"/> <SNMPAgent Name="mydomain"/>
    <JDBCDataSource JNDIName="acsdb" Name="acsdb" PoolName="MyJDBCPool"
    Targets="myserver"/>
    and follows are TestCode,
    url = "t3://localhost:7001"; //default URL
    datasource = "jdbc/acsdb";
    Context ctx = null;
    Hashtable p = new Hashtable();
    p.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, url);
    try{
    ctx = new InitialContext(p);
    System.err.println("initialContext(p)"+ctx); <-- success
    ds = (DataSource)ctx.lookup("java:comp/env/jdbc/acsdb");
    }catch(NameNotFoundException ne){
    throw new ConnectionException(); .
    }catch(NamingException ne){
    throw new ConnectionException();

  • How can I implement the connection pool in my java stored procedure

    my java stored procedures (in database 'B') have to connect to another oracle database ,let's say 'A'. And how can I implement the behavior like the so-called connection pool in my java stored procedure in 'B', as below.
    1. database B, has 2 java stored procedures sp1 and sp2
    2. both sp1 and sp2 connects to databse 'A'
    whatever I call the sp1 and sp2 and the database 'A' always only one connected session from sp1 and sp2 in database 'B'.
    THANKS A LOTS...

    my problem is I have a lots of java stored procedures need to cnnect to the remote oracle db, and I hope the remote db can only have a connected session from my java stored procedures in my local db. I try as below
    class sp{
    static Connection conn=null; //the remote db connection,
    public static void sp1(){...}//procedure 1, using conn
    public static void sp2(){...}//procedure 2, using conn,too
    I can 'see' the 'conn' variable if I invoke the sp1() and sp2() from the same client application(maybe sqlplus). But if I invoke the sp1() from client 'A' and invoke sp2() from client 'B' then the sp1() and sp2() can not see the 'conn' variable for each other. I think it's because the two clients cause oracle to create two instances of the class 'sp' and the sp1() and sp2() located in different instance seperately. Thus the sp1() and sp2() can not see 'conn' for each other. They can only see its own 'conn'.
    To connect to the remote db from the java stored procedure is easy but is it possible to connect to the remote db via database link from the java stored procedure at my local db ? If so, then I also archive my goal .
    BTW , thanks a lots...
    andrew :-)

  • How can I switch the connection pool dynamically during on load happens

    HI,
    I have two data bases which holds same data. i.e Prod_db, Prod_db1,
    I want to switch the connection pool dynamically during load happens
    Ex: During load happens i want to hit prod_db1, after load completes i want to hit prod_db. How to achieve this.

    create dynamic repository variable for DSN using init block so that value is changes based on your timings and use this in connection pool.
    If you use same user and passwords for both the databases that would be easy or else need to follow the same for uid and pwd.
    That should work, if not update.
    If helps pls mark correct/helpful

  • How can I use the built-in Isight camera with an external camera (usb/firewire) at the same time?

    How can I use the built-in Isight camera and an external video camera at the same time?
    I'm wanting to stream over Oovoo/Skype/etc. using 2 cameras.
    Thanks

    Simple question with a not so simple answer.
    (a) If you mean that you want to run multiple apps simultaneously using a different camera with each app, you may encounter computing power limitations.  Digital video is processor intensive.  The only way to know if your Mac can do this it to try it.  If the video does not work together but each app works when it it the only app running, you are likely overloading your Mac's ability to process and/or move all the required data in your data bus.  You can get a better indication of whether this is the case by watching your Activity Monitor utility while running the apps you want to use.
    (b) If you mean that you want to have more than one compatible camera connected to your Mac simultaneously for ease of changing between video sources, some, but not necessarily all, apps you are using to operate your camera(s) allow you to select between your cameras.
    How you select among connected cameras depends on which application you are using. Here is how camera selection works in a few examples:
    (1) For iChat, you can choose which iSight you use in the "Camera:" choices bar in iChat > Preferences... > Audio/Video that appears when more than one compatible camera is connected. Although your camera choices will be different, the choices bar will look something similar to the Preferences settings shown here:
    If you cannot see the "Camera" choices bar, your Mac is recognizing only one (or none) of your cameras. In that case, consider the suggestions fromhttp://support.apple.com/kb/HT2090 for iSight problems or refer to your other camera's documentation for help.
    This particular choices bar solution applies ONLY to iChat. Most other applications also have settings that allow you to choose which camera to use. However, they do not all work the same way.
    (2) For instance, iMovie HD's camera choice is NOT set via Preferences. When you have more than one compatible camera connected, iMovie6 HD uses a drop-down menu choice something like this (depending on which version of iMovie you use):
    Note: Because I had no built-in iSight connected when I made this example, and because my external iSight was not connected, the drop-down menu showed only "Time Lapse." Because your Mac has a built-in iSight, your built-in iSight would show in the drop-down menu even when no other camera is connected. Connecting an additional Mac compatible webcam should allow you to choose either camera.
    Other iMovie versions work slightly differently.
    iMovie 9 (from iLife '11) uses a different camera choice button shown in this article:
      http://docs.info.apple.com/article.html?path=iMovie/9.0/en/mov39f84285.html
    iMovie 8 (from iLife '09) is slightly different as explained in this article:
      http://docs.info.apple.com/article.html?path=iMovie/8.0/en/10172.html
    In general, you can use your Mac's help for the application in use to find out how to select among more than one connected camera.
    (3) Photo Booth in Snow Leopard 10.6.x and later uses the Photo Booth > Camera menu command to select which camera to use.
    Note for readers with older Mac OS X: The previous version of Photo Booth that came with Tiger (10.4.x) is such a simple, basic app that it offers no menu selectable choice. Unless your built-in iSight is already occupied as the camera being used by some open application before you launch Photo Booth, Photo Booth will use ONLY your built-in iSight.
    However, you can use the trick from ¶ 4 of http://docs.info.apple.com/article.html?artnum=302781 to let Photo Booth use an external camera.
    (If you have an external Firewire camera connected, it may be used in preference to any USB webcam. If that is a problem for you, merely disconnect the problem Firewire device.)
    (4) For FaceTime, launch the app and click the Video menu item.
    If your Mac recognizes more than one connected compatible camera, a "Camera" section listing the cameras from which you can choose will appear there. Clicking on the desired camera name will let you select the one you want as shown in this image from my Mac Pro and LED Cinema Display:
    If your Mac recognizes only one compatible camera, the "Camera" section will not appear in the Video menu, but FaceTime will automatically use the connected camera that is recognized by OS X.
    (5) I do not use Skype oir Oovoo.  For those or other apps, see Help for each app for info on how to select your desired camera.
    Message was edited by: EZ Jim

  • How can i use the airport time capsule as a external hard drive?

    how can i use the airport time capsule as a external hard drive?

    Why do you recommend not place things like iTunes libraries or photo libraries on the drive? It was what I am looking for...
    I suggest that you ask the experts over in the iPhoto Support Community about their opinions on placing an iPhoto or Aperture library on the Time Capsule....even if you plan to use a wired connection for your Mac and the Time Capsule.
    But, if Terrence Devlin answers, be prepared for a lecture about why you should not ever do this.
    If you place the iTunes library on the Time Capsule, be prepared for iTunes to give you messages about not being able to find the library.
    In addtion, LaPastenague has the answer for you in a nutshell......corruption problems.
    Bottom line....the Time Capsule is for your backups.....not "everyday" files and especially not libraries.

  • How can I use the gps without internet in my Ipad3 - 4G

    How can I use the gps without internet in my Ipad3 - 4G. Do I need to download any additional app than the one that already came with it?

    The Maps app included in iOS, at least as of the current version, requires an Internet connection, so you'll need to get an app that allows you to download maps to be kept on the iPad. MotionX GPS Drive is one such app, but there are others available.
    Regards.

  • How can I use the battery and let it be perfectly healthy?

    Hello everybody!
    I love this forum because everyone is a great helpful person.. .. However, I'd like to ask you couple things about the MacBook battery...
    I know that now the battery has been improved, it leasts longer and it can support 1000 charging cycles.
    (Right now I'm performing the battery calibration)
    I'd like to know how can I use the battery and let it be perfectly healthy.
    For instance,
    1) If I connect the laptop to the MagSafe and let it charge, when should I remove the plug from the Mac and when should I put it in charge? I don't wanna continously waste cycles and let my battery die too soon (it's too young to die! :-D ) .. I use it mainly at home connected to the MagSafe: someone tell that even if you leave the MagSafe connected after the mac has been charged it stops charging (I can see this), and others say that is not a good thing to let the mac connected to the plug for a long time... with the old model I used to disconnect the battery from the mac so I didn't have these problems but with the new one it's a long procedure...
    2) I usually use to calibrate the battery once a month... Is it a good thing?
    Thanks!
    Andrea

    Everything you need to know about your battery is contained in this User Tip from frequent poster neuroanatomist:
    http://discussions.apple.com/thread.jspa?threadID=1764220

  • How can I use the speakers from my old iMac (with miniRCA? plug) on a new iMac

    How can I use the speakers (M-Audio) from my old 24" iMac on a new 27" iMac?  There is no jack on the new iMac - is there an adapter that will use the mini-RCA (?) plug from my old speakers to connect them to a new iMac?  Thanks ...

    Thanks again!
    Hmmm ... I wonder.  The input jack for external speakers quit working on my old iMac (it made lotsa static noise for a while when I moved the plug or computer, then quit working completely; I figure something inside the computer got loose or crapped out - and I'm too cheap/lazy to take it the 20 miles to the nearest shop that might fix it).  When I plug the speakers into the headphone jack on the old iMac, I get very low volume or just one channel.
    I don't have the new iMac yet, but I was hoping to use these old speakers instead of buying new ones.  I will certainly try your solution - what do I have to lose?  If they don't work, then I get new ones - or try something else.
    Many thanks for your time!

  • HT4847 i have 5gb of icloud storage, used 2.5gb but it wont let me unlock the other 2.5gb of storage. How can i use the remainig 2.5gb of storage?

    i have 5gb of icloud storage, used 2.5gb but it wont let me unlock the other 2.5gb of storage. How can i use the remainig 2.5gb of storage?

    I got rid of AMDS, ASU ,QuickTime and iTunes from control ones I also found folder in Vista with D:\Users\Rick\Music\iTunes\Previous iTunes Library and there is one dated 2009-03012.itl. I moved this file up one folder and delted existing iTunes Library.itl. iTune still failed to identify my iPhone. There are other files iTunes Library Extras.itdb, iTunes Library Geniyes,itdn and iTunes Music Library,xml date dtd 06/18/2009 after upgrade except the latter which is date 06/23/2009. So something is not allowing me to pull or put everything back to when it worked.
    YES this is my only iPhone and only PC I have access to with iTunes.
    Here is what Apple gave to someone Sunday 28 June:
    http://discussions.apple.com/thread.jspa?threadID=2035950&start=75&tstart=0
    I checked these out too and they appear the same printed out nearly a week prior. I agree with Coach TO, if I had bad drivers or Vista errors it would not have shown up only when I updated to latest Version of 8.2.023. My Phone was identified on a PC with iTunes at the local AT&T store. He suggested I get phone into Recovery made while connected to iTunes and that resolves the problem 9 out of 10 time. Weak spot was he tried to get phone into Recovery without iTunes connection and thought I may have iPhone problem, then changed his mind when it worked while connected. He also stated it could take an hour. I have not tried to put my iPhone in Recovery lately, I think I did a while back and it failed to go into Recovery as error "iPhone detected by, not identified..."Has anyone tried forcing phone into Recovery? I understand you may lose all that is on phone. If iTunes still fails to identify would we not be in worse shape even if iTunes holds a recent backup which it does not for many of us? Will Apple take back or exchange phone if yours is not identitifed, AT&T today told me I had to go to Apple Store for this or anything to happen.

  • I cannot load my google calendar, how can i decrypt the connection in order to have access?

    The information about this website says that the page has been encrypted because there is no authorized owner. I need access to my google calendar from work.
    How can i decrypt the connection? Is there other way to fix the problem?

    Restart holding down the CMD+R keys, launch Disk Utility and erase the HD, quit DU, and restore the OS. On first boot, use the Setup Assistant to do the migration. Details in Pondini's Setup New Mac guide.

  • How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    read this
    https://discussions.apple.com/message/20429789#20429789

  • How can I use the print module to print different size images on one large "canvas"?

    How can I use the print module to print different size images on one large "canvas"? An example would be in Photoshop, go to file>new, and create the size paper I want, and move images of different sizes onto it.
    I was thinking the print module would do this automatically for me.

    You can't, at present. It's been a requested feature, so we'll see if it shows up in a future version, but it's not there at present.

  • How can I use the QR codes with my iPad 2. do I need to download first an app ?

    How can I use the/read the QR codes with my iPad 2 ? Do I need to download an app ?

    Yes.  There are quite a few available for free in the app store

  • I have an Apple MacBook Pro with 2 USB ports and a MiniDisplay Port. I also have an HDTV with a HDMI port. How can I use the TV as a display without any tethering wires between my computer and the TV?

    I have an Apple MacBook Pro with 2 USB ports and a MiniDisplay Port. I also have an HDTV with a HDMI port. How can I use the TV as a display without any tethering wires between my computer and the TV? I have a MiniDisplay Port to VGA adapter, but there are two issues with it: The new display doesn't have a VGA port, and even if it did, I wouldn't want to have my mac constantly attached to the display by a cable. I was looking for a way to use the TV as a display without any wires. Is there some type of bluetooth setup I could use? Please let me know if you have any suggestions.

    As I wrote above, I think you should look into the Apple TV yourself. The best place to find information about what it can and can't do and to ask your own specific questions is probably in the Apple TV forum, here:
    https://discussions.apple.com/community/appletv/appletv

Maybe you are looking for

  • How can i debug a Form in 6i environment

    I want to debug a form in 6i environment. WIth trace utility can i do it?if yes pls help me in this

  • Photoshop Elements won't start (Win XP)

    Some one tell me why i should not throw this program in the trash

  • Disc for Java System Copy?

    Hello, Does anyone know which installation master disc to use for a java system (specifically portal 6.0) uses?  The documentation I have says to use the NW04 SR1 Installation Master disc. I have this disc and have applied the installation control pa

  • Screen dimming is driving me insane

    What's up with the constantly changing screen brightness?  I'd turn off enable adaptive brightness in the power plan settings but if I do the screen is too bright for me to look at in a dark room. The "enable adaptive brightness" actually allows the

  • DHCP setup on Time Capsule

    Hi I need to connect a Mitel IP Phone to a Time Capsule that is currently setup on Bridge Mode and working well. The TC gets its internet connection from a ADSL modem/router. When I switch the TC to DHCP/NAT mode I get a Double NAT error. When I swit