• Post Reply Bookmark Topic Watch Topic
  • New Topic

using generalized JDBC  RSS feed

 
sanjay hande
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the normal practice we write the connection and driver code in the same
file for a single java class.

I want to avoid this since i am to use it for more than one file/classes.
By putting the connection and related things in one java file and then using it in jsps. I don't intend to use jstl and i want the jdbc code to be in a separate (java/jsp/bean) file and the jsp code in another file.
This is to avoid the multiple connection openings.
what are the methods to achieve this?

Also i am facing problems while connecting sql server2000 using tomcat5.0.

Is DbConnectionBroker helpful me to do this ?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15890
82
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a connection pool and use DataSource to lookup database connections. Tomcat already contains all of this for you; you don't need DbConnectionBroker (whatever that is).

Read the following part of the Tomcat documentation:
JNDI Datasource HOW-TO
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!