001: /* Copyright (c) 2001-2005, The HSQL Development Group
002: * All rights reserved.
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions are met:
006: *
007: * Redistributions of source code must retain the above copyright notice, this
008: * list of conditions and the following disclaimer.
009: *
010: * Redistributions in binary form must reproduce the above copyright notice,
011: * this list of conditions and the following disclaimer in the documentation
012: * and/or other materials provided with the distribution.
013: *
014: * Neither the name of the HSQL Development Group nor the names of its
015: * contributors may be used to endorse or promote products derived from this
016: * software without specific prior written permission.
017: *
018: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
020: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
021: * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
022: * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
023: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
025: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
026: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
027: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
028: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
029: */
030:
031: package org.hsqldb.util;
032:
033: import java.io.Serializable;
034: import java.util.Vector;
035:
036: /**
037: * Database Transfer Tool
038: * @author Nicolas BAZIN, INGENICO
039: * @version 1.7.0
040: */
041: class DataAccessPoint implements Serializable {
042:
043: Traceable tracer;
044: TransferHelper helper;
045: String databaseToConvert;
046:
047: public DataAccessPoint() {
048:
049: tracer = null;
050: helper = HelperFactory.getHelper("");
051: databaseToConvert = "";
052: }
053:
054: public DataAccessPoint(Traceable t) {
055:
056: tracer = t;
057: helper = HelperFactory.getHelper("");
058:
059: helper.set(null, t, "\'");
060:
061: databaseToConvert = "";
062: }
063:
064: boolean isConnected() {
065: return false;
066: }
067:
068: boolean getAutoCommit() throws DataAccessPointException {
069: return false;
070: }
071:
072: void commit() throws DataAccessPointException {
073: }
074:
075: void rollback() throws DataAccessPointException {
076: }
077:
078: void setAutoCommit(boolean flag) throws DataAccessPointException {
079: }
080:
081: boolean execute(String statement) throws DataAccessPointException {
082: return false;
083: }
084:
085: TransferResultSet getData(String statement)
086: throws DataAccessPointException {
087: return null;
088: }
089:
090: void putData(String statement, TransferResultSet r, int iMaxRows)
091: throws DataAccessPointException {
092: }
093:
094: Vector getSchemas() throws DataAccessPointException {
095: return new Vector();
096: }
097:
098: Vector getCatalog() throws DataAccessPointException {
099: return new Vector();
100: }
101:
102: void setCatalog(String sCatalog) throws DataAccessPointException {
103: }
104:
105: Vector getTables(String sCatalog, String[] sSchemas)
106: throws DataAccessPointException {
107: return new Vector();
108: }
109:
110: void getTableStructure(TransferTable SQLCommands,
111: DataAccessPoint Dest) throws DataAccessPointException {
112: throw new DataAccessPointException("Nothing to Parse");
113: }
114:
115: void close() throws DataAccessPointException {
116: }
117:
118: void beginDataTransfer() throws DataAccessPointException {
119:
120: try {
121: helper.beginDataTransfer();
122: } catch (Exception e) {
123: throw new DataAccessPointException(e.getMessage());
124: }
125: }
126:
127: void endDataTransfer() throws DataAccessPointException {
128:
129: try {
130: helper.endDataTransfer();
131: } catch (Exception e) {
132: throw new DataAccessPointException(e.getMessage());
133: }
134: }
135:
136: /**
137: * @return Returns the helper.
138: */
139: public TransferHelper getHelper() {
140: return helper;
141: }
142: }
|