JDBC Driver Deployment

This document describes J2EE Server support for deploying JDBC drivers to the server. See also the related issue.


Before the J2EE Server deploys a J2EE module with data sources, it tries to deploy appropriate JDBC drivers first, if the server supports it.

The server plug-in supports JDBC driver deployment if it implements the org.netbeans.modules.j2ee.deployment.plugins.spi.JDBCDriverDeployer interface and registers its instance through the org.netbeans.modules.j2ee.deployment.plugins.spi.OptionalDeploymentManagerFactory.

If the server plug-in supports driver deployment, a JDBCDriverDeployer.supportsDeployJDBCDrivers(Target) method is called to check whether JDBC drivers can be deployed to the specific target server and if they can, the JDBCDriverDeployer.deployJDBCDrivers(Target, Set<Datasource>) method is called.

The server plug-in must then find out which drivers should be deployed to the server, deploy them and mark the target server with a 'needs restart' flag, see org.netbeans.modules.j2ee.deployment.plugins.spi.StartServer.needsRestart().

J2EE Server then restarts the target server and deploys the J2EE module.

Support methods

The server plug-in writers might find the following support methods useful when implementing driver deployment support.

org.netbeans.modules.j2ee.deployment.common.api.DatasourceHelper.findDatabaseConnections() - Finds the database connections whose database URL and user name equal the database URL and the user name of the passed data source.

org.netbeans.modules.j2ee.common.Util.containsClass() - Returns true if the specified classpath contains a class of the given name, false otherwise.

See also: Databases And Drivers

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo