Reputation: 145
I'm creating a db connection with Oracle
using JDBC in a JSP page.
Is it safe to call connection every time before querying, as pages contains server side pagination and also some insert/delete queries too? Or Is there any better approach to handle connection instead of calling every time getConnection(...)
?
DriverManager.getConnection(url, user, password);
Upvotes: 1
Views: 119
Reputation: 21
It is not a good practice to create new connection every time in JSP. Instead use connection pooling. You can find more information about connection pooling here - Connection Pooling Strategy For A JSP Site?
Upvotes: 2