At 12:17 PM 12/12/01 +1100, you wrote:
>Not every database API supports connection pooling... Take Postgres for
>example... The JDBC driver for 7.1.2/7.2 does not support connection
>pooling...


As I previously said, the new PostgreSQL driver does support 
pooling.  Also, I think that any driver that implements the contract within 
javax.sql.* must do so.  You did notice that the package mentioned is NOT 
java.sql.*, didn't you?

I find my use of PostgreSQL 7.1.3 does a great job of handling pools and I 
never have to code a lick.  Kinda peoed me off, because I made some of the 
best old database pools seen around these here parts.  Now things are so 
easy for the kids.  ;-)

I did not know 7.2 was available, but 7.13 does the job.  Good luck, and 
you might want to check this out in a bit more detail.  I am not sure what 
the trouble you are having is, but I suspect you don't realize that 
java.sql.* is the starter kit and javax.sql.* is the grown-up table.    I 
hope you don't take this way of expressing the difference wrong.  I am 
merely trying to drive the point home (no pun intended) so you don't keep 
running in circles.

Following is the code I use to get a pool, believe it or not.  Isn't it 
AMAZING?
public class PostgresqlConnection {
     private Connection conn;
     private String     user;
     private String     password;

     public Connection getConnection(String user, String password) throws 
ClassNotFoundException, SQLException {
         Class.forName("org.postgresql.Driver");
         PostgresqlDataSource dataSource = new PostgresqlDataSource();
                 conn = dataSource.getConnection(user, password);
         return conn;
     }
}

So, anyway, you can see there is a PostgresqlDataSource object after 
all.  Otherwise, I am the biggest joker on this list.  Night all.  I've 
copied a couple of pals who might be interested in this code.

-- micael

Reply via email to