01: package org.andromda.maven.plugin.andromdapp;
02:
03: import java.sql.Connection;
04: import java.sql.Driver;
05: import java.sql.DriverPropertyInfo;
06: import java.sql.SQLException;
07:
08: import java.util.Properties;
09:
10: /**
11: * This just wraps a regular JDBC driver so that we can successfully load
12: * a JDBC driver without having to use the System class loader.
13: *
14: * @author Chad Brandon
15: */
16: public class JdbcDriverWrapper implements Driver {
17: private Driver driver;
18:
19: public JdbcDriverWrapper(Driver driver) {
20: this .driver = driver;
21: }
22:
23: /**
24: * @see java.sql.Driver#acceptsURL(java.lang.String)
25: */
26: public boolean acceptsURL(String url) throws SQLException {
27: return this .driver.acceptsURL(url);
28: }
29:
30: /**
31: * @see java.sql.Driver#connect(java.lang.String, java.util.Properties)
32: */
33: public Connection connect(String url, Properties properties)
34: throws SQLException {
35: return this .driver.connect(url, properties);
36: }
37:
38: /**
39: * @see java.sql.Driver#getMajorVersion()
40: */
41: public int getMajorVersion() {
42: return this .driver.getMajorVersion();
43: }
44:
45: /**
46: * @see java.sql.Driver#getMinorVersion()
47: */
48: public int getMinorVersion() {
49: return this .driver.getMinorVersion();
50: }
51:
52: /**
53: * @see java.sql.Driver#getPropertyInfo(java.lang.String, java.util.Properties)
54: */
55: public DriverPropertyInfo[] getPropertyInfo(String url,
56: Properties properties) throws SQLException {
57: return this .driver.getPropertyInfo(url, properties);
58: }
59:
60: /**
61: * @see java.sql.Driver#jdbcCompliant()
62: */
63: public boolean jdbcCompliant() {
64: return this.driver.jdbcCompliant();
65: }
66: }
|