001: /*
002: * Copyright (C) 2006 Rob Manning
003: * manningr@users.sourceforge.net
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: */
019: package net.sourceforge.squirrel_sql.fw.sql;
020:
021: import java.beans.PropertyChangeListener;
022:
023: import net.sourceforge.squirrel_sql.fw.id.IIdentifier;
024: import net.sourceforge.squirrel_sql.fw.id.UidIdentifierFactory;
025: import net.sourceforge.squirrel_sql.fw.persist.ValidationException;
026: import net.sourceforge.squirrel_sql.fw.util.beanwrapper.StringWrapper;
027:
028: public class MockSQLDriver implements ISQLDriver {
029:
030: private String driverClassName = null;
031:
032: private String url = null;
033:
034: private String name = "mockSQLDriver";
035:
036: IIdentifier id = new UidIdentifierFactory().createIdentifier();
037:
038: public MockSQLDriver(String aClassName, String url) {
039: driverClassName = aClassName;
040: this .url = url;
041: }
042:
043: public void assignFrom(ISQLDriver rhs) throws ValidationException {
044: System.err
045: .println("MockSQLDriver.assignFrom: stub not yet implemented");
046: }
047:
048: public int compareTo(ISQLDriver rhs) {
049: System.err
050: .println("MockSQLDriver.compareTo: stub not yet implemented");
051: return 0;
052: }
053:
054: public IIdentifier getIdentifier() {
055: System.err
056: .println("MockSQLDriver.getIdentifier: stub not yet implemented");
057: return null;
058: }
059:
060: public String getDriverClassName() {
061: return driverClassName;
062: }
063:
064: public void setDriverClassName(String aClassName)
065: throws ValidationException {
066: driverClassName = aClassName;
067: }
068:
069: @SuppressWarnings("deprecation")
070: public String getJarFileName() {
071: System.err
072: .println("MockSQLDriver.getJarFileName: stub not yet implemented");
073: return null;
074: }
075:
076: public void setJarFileName(String value) throws ValidationException {
077: System.err
078: .println("MockSQLDriver.setJarFileName: stub not yet implemented");
079: }
080:
081: public StringWrapper[] getJarFileNameWrappers() {
082: System.err
083: .println("MockSQLDriver.getJarFileNameWrappers: stub not yet implemented");
084: return null;
085: }
086:
087: public StringWrapper getJarFileNameWrapper(int idx)
088: throws ArrayIndexOutOfBoundsException {
089: System.err
090: .println("MockSQLDriver.getJarFileNameWrapper: stub not yet implemented");
091: return null;
092: }
093:
094: public void setJarFileNameWrappers(StringWrapper[] value) {
095: System.err
096: .println("MockSQLDriver.setJarFileNameWrappers: stub not yet implemented");
097: }
098:
099: public void setJarFileNameWrapper(int idx, StringWrapper value)
100: throws ArrayIndexOutOfBoundsException {
101: System.err
102: .println("MockSQLDriver.setJarFileNameWrapper: stub not yet implemented");
103: }
104:
105: public String[] getJarFileNames() {
106: System.err
107: .println("MockSQLDriver.getJarFileNames: stub not yet implemented");
108: return null;
109: }
110:
111: public void setJarFileNames(String[] values) {
112: System.err
113: .println("MockSQLDriver.setJarFileNames: stub not yet implemented");
114: }
115:
116: public String getUrl() {
117: return url;
118: }
119:
120: public void setUrl(String url) throws ValidationException {
121: this .url = url;
122: }
123:
124: public String getName() {
125: return this .name;
126: }
127:
128: public void setName(String name) throws ValidationException {
129: this .name = name;
130: }
131:
132: public boolean isJDBCDriverClassLoaded() {
133: System.err
134: .println("MockSQLDriver.isJDBCDriverClassLoaded: stub not yet implemented");
135: return false;
136: }
137:
138: public void setJDBCDriverClassLoaded(boolean cl) {
139: System.err
140: .println("MockSQLDriver.setJDBCDriverClassLoaded: stub not yet implemented");
141: }
142:
143: public void addPropertyChangeListener(
144: PropertyChangeListener listener) {
145: System.err
146: .println("MockSQLDriver.addPropertyChangeListener: stub not yet implemented");
147: }
148:
149: public void removePropertyChangeListener(
150: PropertyChangeListener listener) {
151: System.err
152: .println("MockSQLDriver.removePropertyChangeListener: stub not yet implemented");
153: }
154:
155: /* (non-Javadoc)
156: * @see net.sourceforge.squirrel_sql.fw.sql.ISQLDriver#getWebSiteUrl()
157: */
158: public String getWebSiteUrl() {
159: // TODO Auto-generated method stub
160: return null;
161: }
162:
163: /* (non-Javadoc)
164: * @see net.sourceforge.squirrel_sql.fw.sql.ISQLDriver#setWebSiteUrl(java.lang.String)
165: */
166: public void setWebSiteUrl(String url) throws ValidationException {
167: // TODO Auto-generated method stub
168:
169: }
170:
171: /**
172: * @see java.lang.Object#hashCode()
173: */
174: @Override
175: public int hashCode() {
176: final int prime = 31;
177: int result = 1;
178: result = prime * result + ((id == null) ? 0 : id.hashCode());
179: return result;
180: }
181:
182: /**
183: * @see java.lang.Object#equals(java.lang.Object)
184: */
185: @Override
186: public boolean equals(Object obj) {
187: if (this == obj)
188: return true;
189: if (obj == null)
190: return false;
191: if (getClass() != obj.getClass())
192: return false;
193: final MockSQLDriver other = (MockSQLDriver) obj;
194: if (id == null) {
195: if (other.id != null)
196: return false;
197: } else if (!id.equals(other.id))
198: return false;
199: return true;
200: }
201:
202: }
|