Ideas for Connecting Pool Controller to WRT54G

I am trying to connect a Zodiac iAqualink wireless pool equipment controller to my home network (WRT54G) without success. I need some ideas. This is a 802.11b device. My router is set to mixed mode.
What I have tried:
1. Set it up as suggested in the instructions: WEP2 security, double checked SSID and password
2. Set it up without wireless security
3. Changed channels
4. Set mode to 802.11b
In all cases the LED on the iAqualink that is supposed to indicate that it is connected to the network illuminates properly, but I can never find the device using EasyLink Advisor.
Help!!

tnsguy wrote:
I am trying to connect a Zodiac iAqualink wireless pool equipment controller to my home network (WRT54G) without success. I need some ideas. This is a 802.11b device. My router is set to mixed mode.
What I have tried:
1. Set it up as suggested in the instructions: WEP2 security, double checked SSID and password
2. Set it up without wireless security
3. Changed channels
4. Set mode to 802.11b
In all cases the LED on the iAqualink that is supposed to indicate that it is connected to the network illuminates properly, but I can never find the device using EasyLink Advisor.
Help!!
Are there other wireless devices already working thru your router? Because if that is the case then there might be something wrong with how the Aqualink is connecting to the router. Does you aqualink has an option to connect via the wired connection? Just to verify though if that will work via a wired connection. If it won't work via the wired connection then there might be something wrong with the Aqualink device. You may need to call their tech support to get further assistance.

Similar Messages

  • Using commons dbcp in SOA 8 for connection pool?

    Hi there,
    It is possible to use commons dbcp in SOA 8 for connection pool ing?
    At far I tried SOA 8 does not work either Mckoi and AS400 databases jdbc drivers in a connection pool.
    So having the experience with Tomcat and commons-dbcp with successfull connection pools, I am trying to use a alternative database connection pool, or use SOA8 connection pool using commons-dbcp and it with our AS400 db.
    Do you think it is possible?
    Thanks for your input!
    Lorenzo Jimenez

    I am really lost.
    All I know i that I used this jtopen driver on tomcat with and without connection pool.
    I used the same parameters, but SOA implementation or program is different. Maybe is the 1.4 api, maybe is the jdbc expected.
    Really don't know.
    What I know I as400 and mckoi drivers don't work where in Tomcat work ok.
    Please check this thread with the error that SOA gave to me
    http://forum.java.sun.com/thread.jsp?forum=136&thread=524472&tstart=0&trange=15
    Thanks,
    Lorenzo

  • Principals for connection pools

    We are using a dbms realm for our application on a Bea WeblogicServer
    5.1 on Solaris
    7.
    It seems that it is not possible to use a group as principal for
    a connection pool in the
    weblogic.properties file. This results in a SecurityException when
    a user which is a
    member of the corresponding group tries to get a connection from
    the connection pool.
    Does anybody have similar problems or even better a solution or
    explanation for this
    problem?
    Dieter Arnold
    GFT Technologies AG
    Curiestr. 5
    D-70563 Stuttgart-Vaihingen
    Tel:+49-711-62042-100, Fax: +49-711-62042-101,
    mailto:[email protected]
    http://www.gft.com

    probably not your problem, but groupnames and usernames should
    be unique in weblogic, so if you happen to have a user with the
    same name as the group you are trying to use, it would confuse
    the server.
    but, like I said, probably not your problem.
    -Don
    "Ken Hu" <[email protected]> wrote:
    Dieter,
    I got the same problem as yours when I am working with
    WLS 5.1:
    I have a connection pool set up in the weblogic.properties
    file and a Oracle
    RDBMSRealm. And there is an acl entry in the database
    indicating that a
    certain group has 'reserve' right to the connection pool.
    Then when one user which in fact belongs to that group
    try to use the
    connection pool, he will get SecurityException saying
    that he doesn't has a
    reserve right. But when I change group name of the acl
    entry to that user,
    he is able to use the connection pool. All seems that
    I can't use a group as
    principal in the Connection Pool acl settings.
    But when I used WLS6.0, the problem disappeared. Does
    anybody have any idea?
    Thanks,
    Ken
    Tom Mitchell <[email protected]> wrote in message news:[email protected]..
    Dieter,
    I am not sure I understand what you are trying to do.a group is a
    collection of users and does not have a password. Canyou explain what
    you are trying to accomplish?
    Thanks.
    Dieter Arnold wrote:
    It seems that it is not possible to use a group as
    principal for
    a connection pool in the
    weblogic.properties file. This results in a SecurityExceptionwhen
    a user which is a--
    Tom Mitchell
    [email protected]
    Very Current Stoneham, MA Weather
    http://www.tom.org

  • Credentialling for Connection Pools

    I've been looking at different documents on dev2dev, but being new to the
    security I'm not sure what I'm looking at. That's at least simple humble
    way to say it.
    Is it possible to configure WebLogic (8.1) server to use external
    credentials for a connection pool?
    Thanks,
    Michael

    probably not your problem, but groupnames and usernames should
    be unique in weblogic, so if you happen to have a user with the
    same name as the group you are trying to use, it would confuse
    the server.
    but, like I said, probably not your problem.
    -Don
    "Ken Hu" <[email protected]> wrote:
    Dieter,
    I got the same problem as yours when I am working with
    WLS 5.1:
    I have a connection pool set up in the weblogic.properties
    file and a Oracle
    RDBMSRealm. And there is an acl entry in the database
    indicating that a
    certain group has 'reserve' right to the connection pool.
    Then when one user which in fact belongs to that group
    try to use the
    connection pool, he will get SecurityException saying
    that he doesn't has a
    reserve right. But when I change group name of the acl
    entry to that user,
    he is able to use the connection pool. All seems that
    I can't use a group as
    principal in the Connection Pool acl settings.
    But when I used WLS6.0, the problem disappeared. Does
    anybody have any idea?
    Thanks,
    Ken
    Tom Mitchell <[email protected]> wrote in message news:[email protected]..
    Dieter,
    I am not sure I understand what you are trying to do.a group is a
    collection of users and does not have a password. Canyou explain what
    you are trying to accomplish?
    Thanks.
    Dieter Arnold wrote:
    It seems that it is not possible to use a group as
    principal for
    a connection pool in the
    weblogic.properties file. This results in a SecurityExceptionwhen
    a user which is a--
    Tom Mitchell
    [email protected]
    Very Current Stoneham, MA Weather
    http://www.tom.org

  • Need server.xml and web.xml for connection pooling

    hi guys,
    I am having lots of problem implementing the Connection Pool. I want to use the Tomcat's Connection pool classes and not my connection pool.
    I have gone through lots of problem trying to configure it.
    I got the range of errors. Has someone worked on this. Does it work with Tomcat 4.1 and Oracle 8i. Can anyone provide any links or previous posts to help me out.
    If someone can paste their working server.xml and web.xml then that would be really grt.
    Any kind of help would be really helpful.
    Amit

    Tomcat does not have a connection pooling mechanism. I've used Apache Commons DBCP with Tomcat although with PostgreSQL. It works great.
    Nothing in my web.xml gets modified. Only server.xml needs to be updated for DBCP. The Tomcat JNDI Datasource documentation is very good and should get you through.

  • WebLogic 6.0 SP1 - No JdbcServices for connection pools.

    "My question is what version of WebLogic will the progromatic connection pool creation be re-introduced? Is it available in SP2 or version

    Edit the registry.xml file and change "6.0 Beta" to "6.0"
    -Greg
    On 12 Mar 2001 10:02:19 -0800, "Raman Trikkur" <[email protected]>
    wrote:
    >
    Hello Kumar,
    Here is my registry.xml.
    <?xml version="1.0" encoding="UTF-8"?>
    <bea-product-information>
    <host name="ramantrik2pc">
    <product name="WebLogic Server" format="1.0">
    <release level="6.0 Beta" Status="installed" InstallDir="D:\bea\wlserver6.0"
    InstallTime="Mar 1, 2001 5:18:57 PM" InstallSet="Server">
         <component name="Program" />
         <component name="Samples" />
    </release>
    </product>
    </host>
    </bea-product-information>
    Thanks for helping me figure this out. If this doesn't work,
    I'll just try installing the whole package (WLS 6.0 with SP1
    applied) as Xiang suggested.
    Regards,
    Raman
    Kumar Allamraju <[email protected]> wrote:
    could you post your registry.xml ?
    Raman Trikkur wrote:
    Hi,
    I'm trying to get the service pack SP1 ((wls60sp1_upgrade_win.exe)
    ) installed on my NT box. I have wls 6.0 installed andworking.
    After unpacking and choosing my bea home directory (D:\bea),I
    get an error that says "Weblogic Server Service Pack1 Installation
    failed. You do not seem to have Weblogic server 6.0installed for
    BEAHOME D:\bea".
    But that is untrue. I DO have it installed in D:\bea,and I have
    the environment shell up by running setEnv.cmd and Iinvoked the
    service pack installer from within that shell.
    Is there anything I'm missing? Has anyone else encounteredthis
    problem? Any help with this would be much appreciated.
    Regards,
    Raman

  • Help needed for Connection Pooling

    I want to know about connection pooling in java.Can anyone suggest a best tutorial or link to learn this.

    http://java.sun.com/developer/onlineTraining/Programming/JDCBook/conpool.html
    http://java.sun.com/products/jndi/tutorial/ldap/connect/pool.html
    or better Google it.

  • TIP for Connecting Palm TX to WRT54G

    I recently received a Palm TX as a gift and I spent hours struggling to establish a connection between the Palm and my WiFi Linksys router (WRT54G). I finally got it working, and I wanted to pass along the solution to the problem I was having.
    When setting up WiFi on the Palm TX, you have to enter the security key. To find it, follow these steps on the Palm TX:
    1) Click Preferences > WiFi > Setup
    2) Select the network you want to connect to (your router's SSID, which can be seen on the main page of the Linksys Easy Advisor on your PC).
    3) Click Edit > Configure > Key.
    You have to enter the Encryption Key of your Linksys router, which is found like this:
    1) Open the Linksys Easy Advisor on your PC.
    2) Click the "Support" tab at the top.
    3) Look under "Basic Router Information", and you will see an entry called "Encryption Key".
    The problem I was having is that during my troubleshooting I had accidentally refreshed the Linksys encryption key after I had entered it into the Palm. So the Palm had an encryption key that was no longer valid. Once I went back into the Easy Advisor and realized that the encryption key was now different, I entered the new encryption key into the Palm and all was well.
    So the moral is, don't reset your security settings in the Linksys Easy Advisor, or else you'll need to re-enter the new encryption key in your Palm the next time you want to connect to WiFi!

    Gary, you find the settings the same way you set up the router - use your web browser on your PC to access the settings menu!  You don't physically open the router.
    Enter the IP address for the router (something like http://192.168.1.1 or 192.168.0.1) into the browser address bar and you should gain entry to the settings.  The DNS will be listed somewhere on the setup pages.  You're looking for the listing for the DNS numbers being sent to your router, sometimes called "Primary DNS and Secondary DNS".  Other routers call it DNS1, DNS2, etc.
    I don't own a NetGear router, but I'm sure your manual that came with it will explain things, as well as searching the Netgear site for help.
    This sounds like a simple speed setting (backward-compatible).  You'll need to set the router to transmit in either "/b, /g, and /n" mode or "Mixed B and G"... something like that.
    WyreNut
    Post relates to: Centro (AT&T)
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

  • Any ideas for connecting the ipad2 to a bigger monitor to read music?

    Would something like this work?
    AOC e1649Fwu Black 16"
    Would I be able to use the normal ipad usb connector?

    There are two adapters available for screen mirroring the iPad. You display would need to be compatible with either of these two possible video outputs.
    Apple Digital AV Adapter
    http://store.apple.com/us/product/MD098ZM/A?fnode=MTc0MjU4NjE
    Apple VGA Adapter
    http://store.apple.com/us/product/MC552ZM/B?fnode=MTc0MjU4NjE

  • How to make connection Pool for standalone Application

    hi
    I have got an application to craete a stadalone appliaction for connection pool.But it is taking m more time to create the Connection and fetch the data.
    import java.sql.*;
    import java.util.*;
    /** A class for preallocating, recycling, and managing
    *  JDBC connections.
    *  <P>
    *  Taken from Core Servlets and JavaServer Pages
    *  from Prentice Hall and Sun Microsystems Press,
    *  http://www.coreservlets.com/.
    *  &copy; 2000 Marty Hall; may be freely used or adapted.
    public class ConnectionPool implements Runnable {
      private String driver, url, username, password;
      private int maxConnections;
      private boolean waitIfBusy;
      private Vector availableConnections, busyConnections;
      private boolean connectionPending = false;
      public ConnectionPool(String driver, String url,
                            String username, String password,
                            int initialConnections,
                            int maxConnections,
                            boolean waitIfBusy)
          throws SQLException {
        this.driver = driver;
        this.url = url;
        this.username = username;
        this.password = password;
        this.maxConnections = maxConnections;
        this.waitIfBusy = waitIfBusy;
        if (initialConnections > maxConnections) {
          initialConnections = maxConnections;
        availableConnections = new Vector(initialConnections);
        busyConnections = new Vector();
        for(int i=0; i<initialConnections; i++) {
          availableConnections.addElement(makeNewConnection());
      public synchronized Connection getConnection()
          throws SQLException {
        if (!availableConnections.isEmpty()) {
          Connection existingConnection =
            (Connection)availableConnections.lastElement();
          int lastIndex = availableConnections.size() - 1;
          availableConnections.removeElementAt(lastIndex);
          // If connection on available list is closed (e.g.,
          // it timed out), then remove it from available list
          // and repeat the process of obtaining a connection.
          // Also wake up threads that were waiting for a
          // connection because maxConnection limit was reached.
          if (existingConnection.isClosed()) {
            notifyAll(); // Freed up a spot for anybody waiting
            return(getConnection());
          } else {
            busyConnections.addElement(existingConnection);
            return(existingConnection);
        } else {
          // Three possible cases:
          // 1) You haven't reached maxConnections limit. So
          //    establish one in the background if there isn't
          //    already one pending, then wait for
          //    the next available connection (whether or not
          //    it was the newly established one).
          // 2) You reached maxConnections limit and waitIfBusy
          //    flag is false. Throw SQLException in such a case.
          // 3) You reached maxConnections limit and waitIfBusy
          //    flag is true. Then do the same thing as in second
          //    part of step 1: wait for next available connection.
          if ((totalConnections() < maxConnections) &&
              !connectionPending) {
            makeBackgroundConnection();
          } else if (!waitIfBusy) {
            throw new SQLException("Connection limit reached");
          // Wait for either a new connection to be established
          // (if you called makeBackgroundConnection) or for
          // an existing connection to be freed up.
          try {
            wait();
          } catch(InterruptedException ie) {}
          // Someone freed up a connection, so try again.
          return(getConnection());
      // You can't just make a new connection in the foreground
      // when none are available, since this can take several
      // seconds with a slow network connection. Instead,
      // start a thread that establishes a new connection,
      // then wait. You get woken up either when the new connection
      // is established or if someone finishes with an existing
      // connection.
      public void makeBackgroundConnection() {
        connectionPending = true;
        try {
          Thread connectThread = new Thread(this);
          connectThread.start();
        } catch(OutOfMemoryError oome) {
          // Give up on new connection
      public void run() {
        try {
          Connection connection = makeNewConnection();
          synchronized(this) {
            availableConnections.addElement(connection);
            connectionPending = false;
            notifyAll();
        } catch(Exception e) { // SQLException or OutOfMemory
          // Give up on new connection and wait for existing one
          // to free up.
      // This explicitly makes a new connection. Called in
      // the foreground when initializing the ConnectionPool,
      // and called in the background when running.
      public Connection makeNewConnection()
          throws SQLException {
        try {
          // Load database driver if not already loaded
          Class.forName(driver);
          // Establish network connection to database
          Connection connection =
            DriverManager.getConnection(url, username, password);
          return(connection);
        } catch(ClassNotFoundException cnfe) {
          // Simplify try/catch blocks of people using this by
          // throwing only one exception type.
          throw new SQLException("Can't find class for driver: " +driver);
      public synchronized void free(Connection connection) {
        busyConnections.removeElement(connection);
        availableConnections.addElement(connection);
        // Wake up threads that are waiting for a connection
        notifyAll();
      public synchronized int totalConnections() {
        return(availableConnections.size() +
               busyConnections.size());
      /** Close all the connections. Use with caution:
       *  be sure no connections are in use before
       *  calling. Note that you are not <I>required</I> to
       *  call this when done with a ConnectionPool, since
       *  connections are guaranteed to be closed when
       *  garbage collected. But this method gives more control
       *  regarding when the connections are closed.
      public synchronized void closeAllConnections() {
        closeConnections(availableConnections);
        availableConnections = new Vector();
        closeConnections(busyConnections);
        busyConnections = new Vector();
      public void closeConnections(Vector connections) {
        try {
          for(int i=0; i<connections.size(); i++) {
            Connection connection =
              (Connection)connections.elementAt(i);
            if (!connection.isClosed()) {
              connection.close();
        } catch(SQLException sqle) {
          // Ignore errors; garbage collect anyhow
      public synchronized String toString() {
        String info =
          "ConnectionPool(" + url + "," + username + ")" +
          ", available=" + availableConnections.size() +
          ", busy=" + busyConnections.size() +
          ", max=" + maxConnections;
        return(info);
    }///// The Calling Class is below---------/////////////////
    import java.util.*;
    import java.sql.*;
    public class dbConnection
         public static void main(String[] args)
              String driver="oracle.jdbc.driver.OracleDriver";
              String username="ETS";
              String password="ETS";
              String url="jdbc:oracle:thin:@192.168.47.10:1521:ETS";
              int initialConnections=10;
            int maxConnections=50;
              boolean waitIfBusy=false;
              Connection con=null;
              Statement stmt = null;
              ResultSet rs = null;
              try
              System.out.println("Before constructory "+new java.util.Date());
              ConnectionPool pool=new ConnectionPool(driver,url,username,password,initialConnections,maxConnections,waitIfBusy);
              System.out.println("After constructory "+new java.util.Date());
                        con=pool.makeNewConnection();
         System.out.println("After Connection pool "+new java.util.Date());
                        String sql="select * from emp_master";
                        stmt = con.createStatement();
                        rs = stmt.executeQuery(sql);
                        while(rs.next()) {
                   int login1=rs.getInt("emp_code");     
                        System.out.println("Employee Code is  "+login1);
                        System.out.println("check 2");
                   String pass=rs.getString("PASSWORD");
                        System.out.println("Pass Word is "+pass);
              }catch(Exception e)
                   System.out.println("Exception is "+e);
              finally {
    }

    I once created a connection pool programatically with Apache DBCP API. It didnt took more than 10 lines. Unforchunetly I dont have to code with me now.
    But If I remember right there is a sample code for that in the Apache Commans DBCP documentation.

  • Requirements for JDBC Driver needed for SOA 8 }connection pool

    Hi,
    I have an AS400 jdbc driver. This driver is JDBC API version 2.x. Also is a Driver Type 4.
    What are the requirements of a JDBC Driver needed for connection pool in SOA 8?
    Thanks.
    Lorenzo Jimenez

    You can use pretty much any jdbc driver, including type 2 and type 4.
    You need to make sure your shared libraries needed by the driver are available to the appserver when you boot.
    Other than that, it is no different than configuring any other driver.

  • Java Connection Pooling issue with Oracle 10g Express Edition

    Hello
    I have a Java based web application that uses the Oracle 10g Express Edition database. I am using a connection pool to get connections to the database.
    I use the NetBeans IDE and run my web application on the bundled Tomcat server(5.5.7) that comes with the IDE. Though when I initially run the application from the IDE, the connection pool is set up fine, when I recompile my java code and try to run the application again, I get the following error each time:
    Listener refused the connection with the following error:
    ORA-12516, TNS:listener could not find available handler with the
    matching protocol stack.
    The logs before the error shows up, indicate that the connection pool object is fine and gives me the number of available connections and the number of active connections and so on, which I have printed from the constructor of the Connection Pool class:
    For e.g.:
    Cache size = 17
    Available Connections = 17
    Cache Limit = 1000
    Active size = 0
    However, if I kill my Tomcat server process and run the application again, it works fine with no error.
    I looked around for possible causes and solutions and all I could find
    was increasing the processes parameter value in the init.ora file. I have increased the parameter value to from 100 to 20000 now, in increments of 500/1000 each time but it hasnt worked so far.
    Someone else suggested that I increase the size of my connection pool; I initially had it set to a minimum limit of 5, an initial limit of 10 and a maximum limit of 1000. However if I set the Initial Limit to anything above 17 connections, I see the following log on the Bundled Tomcat log and my application doesn't run at all:
    Log: Loading JDBC Driver : class=oracle.jdbc.driver.OracleDriver ...
    Log: Loaded JDBC Driver
    Log: Connection with URL=jdbc:oracle:thin:@localhost:1521:xe as username/password
    Error code not handled : 0
    Exception Message :java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12519, TNS: no appropriate service handler found
    The Connection descriptor used by the client was:
    localhost:1521:xe
    // End of log
    And the Bundled Tomcat server automatically shuts down.
    Again the System.out statements from the Connection Pool class constructor show that the cache has been initialized and that currently there are free connections available in the pool.
    E.g.
    Cache size = 18
    Available Connections = 18
    Cache Limit = 1000
    Active size = 0
    Has anyone faced anything similar? Could someone please suggest what I'm doing wrong here and what I should do to set right this problem?
    Swetha

    hello, please pardon me, my english is basic. i do of my best. i had the same problem until reading the pdf documentation 2 days for java devvelloper.it is simple, follow this way.
    try {OracleDataSource ds;
         Connection conn;
      ds = new OracleDataSource();
      ds.setURL("jdbc:oracle:thin:@localhost");
      conn = ds.getConnection("userid","password");
    Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    don't forget to Dowload the user client of oracle Express Edition. do the rest of your program and it will work. take a look to the documentation pdf for java develloper. all it is explained.  good look                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Connection pooling implementation in struts

    hi I want to implement login process in struts but now i m facing problem , I have written the code for connection pooling but now m in confusion where to call this code bcoz it should be called at once if not called earlier, so that i can use this connection object in search, add, delete, and update actions.
    thanks in advance
    pranav

    thanks a lot, but i didn't get my answer. i want to know where adjectly i need to call this connection pooling class in modal or in controller of struts?

  • Connection Pooling .. Cant Close Them!

    Hi,
    I have an application that goes off to a SQL Server database and pulls back certain data. I am currently just opening a new connection, and then getting the data and then closing the connection.
    This is proving to be quite expensive in resources, and is very slow.
    I took the step to move to connection pooling.
    What I have found is that it DRAMATICALLY increased the speed of returning the data, though when I look at the processors running on the database, there seem to be heaps of connections on there, and they dont seem to close down or time out.
    Is this usually the way this works?
    Thanks
    M
    Here is my connection pooling code.
    ConnectionPool.java
    package con;
    import java.sql.*;
    import java.util.*;
    public class ConnectionPool {
    // JDBC Driver Name
    private String driver = null;
    // URL of database
    private String url = null;
    // Initial number of connections.
    private int size = 5;
    // Username
    private String username = new String("username");
    // Password
    private String password = new String("password");
    // Vector of JDBC Connections
    private Vector pool = null;
    public ConnectionPool() {
    // Set the value of the JDBC Driver
    public void setDriver(String value) {
    if ( value != null ) {
    driver = value;
    // Get the value of the JDBC Driver
    public String getDriver() {
    return driver;
    // Set the URL Pointing to the Datasource
    public void setURL(String value ) {
    if ( value != null ) {
    url = value;
    // Get the URL Pointing to the Datasource
    public String getURL() {
    return url;
    // Set the initial number of connections
    public void setSize(int value) {
    if ( value > 1 ) {
    size = value;
    // Get the initial number of connections
    public int getSize() {
    return size;
    // Set the username
    public void setUsername(String value) {
    if ( value != null ) {
    username = value;
    // Get the username
    public String getUserName() {
    return username;
    // Set the password
    public void setPassword(String value) {
    if ( value != null ) {
    password = value;
    // Get the password
    public String getPassword() {
    return password;
    // Creates and returns a connection
    private Connection createConnection() throws Exception {
    Connection con = null;
    // Create a Connection
    con = DriverManager.getConnection(url,
    username, password);
    return con;
    // Initialize the pool
    public synchronized void initializePool() throws Exception {
    // Check our initial values
    if ( driver == null ) {
    throw new Exception("No Driver Name Specified!");
    if ( url == null ) {
    throw new Exception("No URL Specified!");
    if ( size < 1 ) {
    throw new Exception("Pool size is less than 1!");
    // Create the Connections
    try {
    // Load the Driver class file
    Class.forName(driver);
    // Create Connections based on the size member
    for ( int x = 0; x < size; x++ ) {
    Connection con = createConnection();
    if ( con != null ) {
    // Create a PooledConnection to encapsulate the
    // real JDBC Connection
    PooledConnection pcon = new PooledConnection(con);
    // Add the Connection to the pool.
    addConnection(pcon);
    catch (Exception e) {
    System.err.println(e.getMessage());
    throw new Exception(e.getMessage());
    // Adds the PooledConnection to the pool
    private void addConnection(PooledConnection value) {
    // If the pool is null, create a new vector
    // with the initial size of "size"
    if ( pool == null ) {
    pool = new Vector(size);
    // Add the PooledConnection Object to the vector
    pool.addElement(value);
    public synchronized void releaseConnection(Connection con) {
    // find the PooledConnection Object
    for ( int x = 0; x < pool.size(); x++ ) {
    PooledConnection pcon =
    (PooledConnection)pool.elementAt(x);
    // Check for correct Connection
    if ( pcon.getConnection() == con ) {
    System.err.println("Releasing Connection " + x);
    // Set its inuse attribute to false, which
    // releases it for use
    pcon.setInUse(false);
    break;
    // Find an available connection
    public synchronized Connection getConnection()
    throws Exception {
    PooledConnection pcon = null;
    // find a connection not in use
    for ( int x = 0; x < pool.size(); x++ ) {
    pcon = (PooledConnection)pool.elementAt(x);
    // Check to see if the Connection is in use
    if ( pcon.inUse() == false ) {
    // Mark it as in use
    pcon.setInUse(true);
    // return the JDBC Connection stored in the
    // PooledConnection object
    return pcon.getConnection();
    // Could not find a free connection,
    // create and add a new one
    try {
    // Create a new JDBC Connection
    Connection con = createConnection();
    // Create a new PooledConnection, passing it the JDBC
    // Connection
    pcon = new PooledConnection(con);
    // Mark the connection as in use
    pcon.setInUse(true);
    // Add the new PooledConnection object to the pool
    pool.addElement(pcon);
    catch (Exception e) {
    System.err.println(e.getMessage());
    throw new Exception(e.getMessage());
    // return the new Connection
    return pcon.getConnection();
    // When shutting down the pool, you need to first empty it.
    public synchronized void emptyPool() {
    // Iterate over the entire pool closing the
    // JDBC Connections.
    for ( int x = 0; x < pool.size(); x++ ) {
    System.err.println("Closing JDBC Connection " + x);
    PooledConnection pcon =
    (PooledConnection)pool.elementAt(x);
    // If the PooledConnection is not in use, close it
    if ( pcon.inUse() == false ) {
    pcon.close();
    else {
    // If it is still in use, sleep for 30 seconds and
    // force close.
    try {
    java.lang.Thread.sleep(30000);
    pcon.close();
    catch (InterruptedException ie) {
    System.err.println(ie.getMessage());
    PooledConnection.java
    package con;
    import java.sql.*;
    public class PooledConnection {
    // Real JDBC Connection
    private Connection connection = null;
    // boolean flag used to determine if connection is in use
    private boolean inuse = false;
    // Constructor that takes the passed in JDBC Connection
    // and stores it in the connection attribute.
    public PooledConnection(Connection value) {
    if ( value != null ) {
    connection = value;
    // Returns a reference to the JDBC Connection
    public Connection getConnection() {
    // get the JDBC Connection
    return connection;
    // Set the status of the PooledConnection.
    public void setInUse(boolean value) {
    inuse = value;
    // Returns the current status of the PooledConnection.
    public boolean inUse() {
    return inuse;
    // Close the real JDBC Connection
    public void close() {
    try {
    connection.close();
    catch (SQLException sqle) {
    System.err.println(sqle.getMessage());
    <html>
    <body>
    <%@ page errorPage="errorpage.jsp" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    <!-- Instantiate the ConnectionPool bean with an id of "pool" -->
    <jsp:useBean id="pool" scope="application" class="con.ConnectionPool" />
    <%
    Connection con = null;
    try {
    // The pool is not initialized
    if ( pool.getDriver() == null ) {
    // initialize the pool
    pool.setDriver("sun.jdbc.odbc.JdbcOdbcDriver");
    pool.setURL("jdbc:odbc:Stuff");
    pool.setSize(5);
    pool.initializePool();
    // Get a connection from the ConnectionPool
    con = pool.getConnection();
    // Create the statement
    Statement statement = con.createStatement();
    // Use the created statement to SELECT the DATA
    // FROM the Titles Table.
    ResultSet rs = statement.executeQuery("SELECT * " +
    "FROM Titles");
    // Iterate over the ResultSet
    %>
    <!-- Add an HTML table to format the results -->
    <center>
    <table border="1" cellspacing="0" cellpadding="2"width="500">
    <tr>
    <th>Title</th><th>Rating</th><th>Price</th><th>Quantity</th>
    <%
    while ( rs.next() ) {
    // get the title_name, which is a String
    out.println("<tr>\n<td>" +
    rs.getString("title_name") + "</td>");
    // get the rating
    out.println("<td align=\"center\">" +
    rs.getString("rating") + "</td>");
    // get the price
    out.println("<td align=\"center\">" +
    rs.getString("price") + "</td>");
    // get the quantity
    out.println("<td align=\"center\">" +
    rs.getString("quantity") + "</td>\n</tr>");
    // Close the ResultSet
    rs.close();
    out.println("</table></center>");
    catch (IOException ioe) {
    out.println(ioe.getMessage());
    catch (SQLException sqle) {
    out.println(sqle.getMessage());
    catch (ClassNotFoundException cnfe) {
    out.println(cnfe.getMessage());
    catch (Exception e) {
    out.println(e.getMessage());
    finally {
    try {
    if ( con != null ) {
    // release the connection no matter what
    pool.releaseConnection(con);
    catch (Exception e) {
    out.println(e.getMessage());
    %>
    </body>
    </html>

    No, it's not the same....
    Here....
    The basic idea behind connection pooling is simple. In an application that opens and closes many database connections, it is efficient to keep unused Connection objects in a pool for future re-use. This saves the overhead of having to open a new physical connection each time a connection is opened.
    The JdbcConnectionPool.getConnection() method tries to save the overhead of opening a new connection by using a connection that is already in the pool. When a lookup is performed to find a connection in the pool, a match is found if the user name equals the user name that was originally used to create the pooled connection. Password is not considered when trying to match a user. A new connection is requested from the factory only if no match is found in the pool.
    When an application uses connection pooling, a connection should always be explicitly closed when no longer in use. This allows the connection to be returned to the pool for later use, which improves performance.
    The factory which creates connections for the pool should use the same property settings for all of them, except for the user name and password. A connection pool, therefore, accesses one database, and all its connections have the same JDBC connection property settings (but can have different usernames/passwords).

  • How database connection pooling works in a application

    Hi Guys,
    I am new to Java and looking into best way of doing J2ee database conectivity. I am using Eclipse galileo3.5 J2EE with Mysql database and Tomcate 6.0.
    I am developing an email application where I need to implement MVC model for my webapplication, using jsp for presentation, servlet for control and java beans for model.
    I came across two tutorial for database connection pooling as given below.
    Eclipse Corner Article: Creating Database Web Applications with Eclipse - In this tutorial connection pooling is configure in Tomcate 6.0
    It says Copy and paste the following into your context.xml file (you may have to click on the Source tab at the bottom of the editor to be able to paste). This defines a DataSource with the name "jdbc/SampleDB". Our application will retrieve database connections from the pool using this name.
    <?xml version="1.0" encoding="UTF-8"?>
    <Context>
    <Resource name="jdbc/SampleDB" auth="Container"
    type="javax.sql.DataSource"
    username="app" password="app"
    driverClassName="org.apache.derby.jdbc.ClientDrive r"
    url="jdbc:derby://localhost:1527/sample"
    maxActive="8" />
    </Context>
    Where as in second tutorial - http://www.roseindia.net/answers/viewanswers/2838.html
    It uses java bean for connection pooling and then use straight way in JSP and no Servlet used.
    conpool.jsp
    <%@page import="java.sql.Connection"%>
    <jsp:useBean id="pl" class="com.CoreJava.ConnectionPooling"/>
    <% Connection con = pl.getConnection(); %>
    //do something using con
    connectionPooling.java
    import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolD ataSource;
    public class ConnectionPooling
    static Connection con=null;
    public static Connection getConnection()
    try
    MysqlConnectionPoolDataSource po=new MysqlConnectionPoolDataSource();
    po.setServerName("localhost");
    po.setPortNumber(3306);
    po.setDatabaseName("mydatabase"); //changeur database name
    po.setUser("root");//ur username
    po.setPassword("");//ur password
    con = po.getConnection();
    catch(Exception e)
    System.out.println("Exception Connection :"+e);
    return con;
    Please some one explain which is the best way of doing connection pooling to the database by using MVC pattern
    Please if some one advise me how to use MVC architecture for simple email application and database connectivty.
    Thanks

    >
    >
    Where as in second tutorial - http://www.roseindia.net/answers/viewanswers/2838.html
    Never EVER use roseindia. It is terrible shit.
    [http://balusc.blogspot.com/2008/06/what-is-it-with-roseindia.html]
    The correct answer is what you found in the eclipse article. And you can read the Tomcat docs for more.
    As per usual the code you have posted from Roseindia is a big pile of rubbish that was written by a complete idiot. I mean the person who wrote it apparently doesn't know much Java at all. Let alone JDBC. Or Connection pools. Or J2EE. It's not the worst I've seen from them but it's pretty bad.

Maybe you are looking for