Friday, June 19, 2009
Different ways of getting database connection
There are two ways of getting JDBC connection in java. One is from Driver Manager and the other is from an object of javax.sql.DataSource. The data source can be obtained from JNDI look up or by any other means. The implementation of Data Source internally uses the DriverManager but can pool the connections and reuse them and can give wrappers on actual connection so that when you call the close method, the connection is returned to the pool instead of actually closing the underlying connection.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment