Professional Documents
Culture Documents
Advanced JDBC
1. Connection Pooling.
2. Transaction Management.
The above 2 advanced topics are implemented in the package called javax.sql .
• We need to hardcode Driver class, url, uid, pwd, in every jdbc program. In
future if the database is migrated then you need to modify everywhere in the
program. This increases the maintenance of the application and reduces the
system flexibility.
The problem discussed above can be solved when you replace DriverManager
connection management with DataSource connection management.
JNDI Registry
(LDAP Server)
hello
datasource
datasource datasour
ce
Object o = c c
ctx.lookup(“hello”); o o
cn cn
ds = (DataSource)o; o o
Java program n n
Application Server
1) Database(Oracle)
2) Driver class
3) url
HARISH Page 1
ADVANCED JDBC
4) uid
5) pwd
HARISH Page 2