kjkoster
21-07-2008, 21:12
Dear All,
There seems to be some disagreement as to where to place key JAR files in JEE application servers. In particular, where to place the JDBC driver JAR? In the container or in the web application?
Let's consider the roles around a container that is running in production. In a very simplified model those roles are system administrator and developer. And they can be responsible for three things, again in a simplified model: the web application, the JEE server, or the OS and hardware below that.
Most shops agree that system administrators are responsible for the hardware and the OS. Let's go with that, for the sake of argument. When it comes to the web application, the responsibility rests with the developer. That is the person who creates the application and packages it for deployment. All clear so far.
When it comes to the JEE server, responsibilities become a lot more vague1. In some shops the application developers package a JEE server with their application, offering the combination as the deployment unit. In other shops, the JEE server is managed by the system administrators, and the developers deliver WAR files as the deployment unit. The image jdbc_jar_responsibility.001.jpg illustrates this.
In a shop where the developers are responsible for both the JEE server and the web application, placement of the JDBC driver is entirely a matter of taste. I would say: he who does the work decides.
Most shops have a model where the JEE server is a system administrator responsibility, and the developers stick to making web applications. For such situations, placement of the JDBC driver JAR reflects the responsibility of configuring the database access. In other words, the team that configures the database URL, user name and password gets the JAR file in its domain.
Thus, if the developers have the passwords to the production databases, the configure them in their web application and they keep the JDBC driver JAR in WEB-INF/lib.
If on the other hand, the administrators are responsible for providing the database connection settings, that is best done through a data source that the container provides to the web application. This frees the application from most of the database dependency. The image jdbc_jar_responsibility.002.jpg illustrates this.
Then again, sometimes the web application needs a very specific database driver to work (Oracle objects, I'm looking at you). In that case, the JDBC driver goes into the web application again. It's part of the code in that way. Setting the JDBC connection properties without revealing them to the developers is left as an exercise to the reader.
Kees Jan
1. Of course, there are shops where the developers and administrators are still haggling over who is responsible for what. In that case, the location of their JDBC drivers is the least of their worries. ;-)
There seems to be some disagreement as to where to place key JAR files in JEE application servers. In particular, where to place the JDBC driver JAR? In the container or in the web application?
Let's consider the roles around a container that is running in production. In a very simplified model those roles are system administrator and developer. And they can be responsible for three things, again in a simplified model: the web application, the JEE server, or the OS and hardware below that.
Most shops agree that system administrators are responsible for the hardware and the OS. Let's go with that, for the sake of argument. When it comes to the web application, the responsibility rests with the developer. That is the person who creates the application and packages it for deployment. All clear so far.
When it comes to the JEE server, responsibilities become a lot more vague1. In some shops the application developers package a JEE server with their application, offering the combination as the deployment unit. In other shops, the JEE server is managed by the system administrators, and the developers deliver WAR files as the deployment unit. The image jdbc_jar_responsibility.001.jpg illustrates this.
In a shop where the developers are responsible for both the JEE server and the web application, placement of the JDBC driver is entirely a matter of taste. I would say: he who does the work decides.
Most shops have a model where the JEE server is a system administrator responsibility, and the developers stick to making web applications. For such situations, placement of the JDBC driver JAR reflects the responsibility of configuring the database access. In other words, the team that configures the database URL, user name and password gets the JAR file in its domain.
Thus, if the developers have the passwords to the production databases, the configure them in their web application and they keep the JDBC driver JAR in WEB-INF/lib.
If on the other hand, the administrators are responsible for providing the database connection settings, that is best done through a data source that the container provides to the web application. This frees the application from most of the database dependency. The image jdbc_jar_responsibility.002.jpg illustrates this.
Then again, sometimes the web application needs a very specific database driver to work (Oracle objects, I'm looking at you). In that case, the JDBC driver goes into the web application again. It's part of the code in that way. Setting the JDBC connection properties without revealing them to the developers is left as an exercise to the reader.
Kees Jan
1. Of course, there are shops where the developers and administrators are still haggling over who is responsible for what. In that case, the location of their JDBC drivers is the least of their worries. ;-)