01: package com.mockrunner.mock.jdbc;
02:
03: import java.sql.Connection;
04: import java.sql.Driver;
05: import java.sql.DriverPropertyInfo;
06: import java.sql.SQLException;
07: import java.util.Properties;
08:
09: /**
10: * Mock implementation of a JDBC <code>Driver</code>.
11: */
12: public class MockDriver implements Driver {
13: private Connection connection;
14:
15: public void setupConnection(Connection connection) {
16: this .connection = connection;
17: }
18:
19: public int getMajorVersion() {
20: return 1;
21: }
22:
23: public int getMinorVersion() {
24: return 0;
25: }
26:
27: public boolean jdbcCompliant() {
28: return true;
29: }
30:
31: public boolean acceptsURL(String url) throws SQLException {
32: return true;
33: }
34:
35: public Connection connect(String url, Properties info)
36: throws SQLException {
37: return connection;
38: }
39:
40: public DriverPropertyInfo[] getPropertyInfo(String url,
41: Properties info) throws SQLException {
42: return new DriverPropertyInfo[0];
43: }
44: }
|