For your first question:
and how can we directly write rs.next() You've seen the code like
Class.forName("name.of.Driver"); at the start of JDBC code? There is a bit of a trick here. This causes the Driver class to be loaded, and when it loads it registers itself with the DriverManager.
When you call DriverManager.getConnection(jdbcURL), the DriverManager asks each of the registered Drivers (there can be many) who understands the
string. If you set things up correctly, your Driver says "I do!", and then returns a Connection.
What you get passed is a Connection (ie an interface), but the implementing Class gets decided by the DriverManager and Driver working together. The Connection decides which Statement to pass to you, and the Statement gives you a ResultSet. They are all interfaces, but under the covers there are concrete implementations starting with the Driver.
As to your second question:
How can I create connection pooling ? Don't. Download an existing implementation. Connection Pooling is easy to do badly and hard to do well. There are free versions out there, so just use them.
How to use connection store in connection pooling ? It's all in the configuration. Rather than including the JDBC settings in code, you usually put the Connection Pool setup info in a config file and it just works. Rather than talking to the DriverManager to get Connections, you get them from the Connection Pool instead.
Finally, It is better to ask separate questions in separate threads, then we can cover them in their individual merits.
Hope this helps,
Dave