Step to build a connection pool:
Download the DBCP.jar file from the www.apache.org and the relationship.jar files(commons-collection-3.1.jar,commons-pool-1.2.jar);
Setup your class_path;
Setup a database or Select a database to connect.
BasicDatasource ds=new BasicDatasource();
ds.setDriverClassName(com.microsoft.jdbc.sqlserver.
SQLServerManager);
ds.setUsername(“sa”);
ds.setPassword(“”);
ds.setUrl("jdbc:microsoft:sqlserver://localhost:1433;User=sa;P assword=;DatabaseName=softeem");
Connection conn=ds.getConnection();
Statement s=conn.createStatement();
ResultSet rs=s.executeQuery(SQL);
s.close();
rs.close();
conn.close();