01: /*
02: Loader - tool for transfering data from one JDBC source to another and
03: doing transformations during copy.
04: Copyright (C) 2002 Together
05: This library is free software; you can redistribute it and/or
06: modify it under the terms of the GNU Lesser General Public
07: License as published by the Free Software Foundation; either
08: version 2.1 of the License, or (at your option) any later version.
09: This library is distributed in the hope that it will be useful,
10: but WITHOUT ANY WARRANTY; without even the implied warranty of
11: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: Lesser General Public License for more details.
13: You should have received a copy of the GNU Lesser General Public
14: License along with this library; if not, write to the Free Software
15: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16: /*
17: * CreateDatabaseOperation.java Aug 30, 2002
18: * Author : Sinisa Milosevic sinisami@eunet.yu
19: *
20: */
21:
22: package org.webdocwf.util.loader.test;
23:
24: import java.sql.Connection;
25: import java.sql.Statement;
26: import org.webdocwf.util.loader.test.DatabaseOperation;
27: import org.webdocwf.util.loader.Loader;
28: import org.webdocwf.util.loader.LoaderException;
29:
30: import java.sql.SQLException;
31:
32: /**
33: * Inserts data in tables using Loader.
34: *
35: * @author Sinisa Milosevic
36: * @version $Revision: 1.1 $
37: */
38: public class LoaderOperation extends DatabaseOperation {
39:
40: private Loader loadJob = null;
41:
42: public LoaderOperation() {
43: }
44:
45: public LoaderOperation(Loader load) {
46: loadJob = load;
47: }
48:
49: public void setLoader(Loader load) {
50: loadJob = load;
51: }
52:
53: ////////////////////////////////////////////////////////////////////////////
54: // DatabaseOperation class
55:
56: /**
57: * Executes this operation on the specified database using the specified
58: * connection to the database.
59: *
60: * @param conn the database connection.
61: */
62:
63: public void execute(Connection conn) throws SQLException {
64: }
65:
66: /**
67: * Executes this operation on the specified database using the Loader.
68: *
69: */
70:
71: public void execute() throws LoaderException {
72:
73: loadJob.load();
74:
75: }
76:
77: /**
78: * Returns type of database operation
79: *
80: */
81: public String getDatabaseOperationType() {
82: return DatabaseOperation.LOADER;
83: }
84:
85: }
|