View Javadoc
1 /* 2 * PROJECT : DAR Runtime and Tools 3 * COPYRIGHT : Copyright (C) 1999-2004 tim.stephenson@enableit.org 4 * LICENSE : GNU LESSER GENERAL PUBLIC LICENSE 5 * Version 2.1, February 1999 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 */ 21 package org.enableit.db.ant; 22 23 import org.apache.log4j.Logger; 24 25 26 /*** 27 * Abstract Ant Task that requires database connection data. 28 * 29 * @version __VERSION__ 30 * 31 * @author __AUTHOR__ 32 */ 33 public abstract class AbstractDBTask extends org.apache.tools.ant.Task { 34 /*** 35 * The Log4J <code>Logger</code> doing the logging. 36 */ 37 private static Logger logger = Logger.getLogger(AbstractDBTask.class); 38 39 /* 40 * Properties 41 */ 42 43 /*** 44 * The JDBC driver's class name. 45 */ 46 protected String driver; 47 48 /*** 49 * The database URL to connect to. 50 */ 51 protected String url; 52 53 /*** 54 * Username to use when connecting to the database. 55 */ 56 protected String userid; 57 58 /*** 59 * Schema name to use when connecting to the database. 60 */ 61 protected String schemaName; 62 63 /*** 64 * Password to use when connecting to the database. 65 */ 66 protected String password = ""; 67 68 /* 69 * Constructors 70 */ 71 72 /*** 73 * Default Constructor 74 */ 75 public AbstractDBTask() { 76 super(); 77 } 78 79 /*** 80 * Sets the JDBC driver to use in making a connection 81 */ 82 public void setDriver(String driver) { 83 this.driver = driver; 84 } 85 86 /*** 87 * Sets the JDBC url to connect to. 88 */ 89 public void setUrl(String url) { 90 this.url = url; 91 } 92 93 /*** 94 * Sets the JDBC password to use in making a connection 95 */ 96 public void setPassword(String password) { 97 this.password = password; 98 } 99 100 /*** 101 * Sets the JDBC userid to use in making a connection 102 */ 103 public void setUserid(String userid) { 104 this.userid = userid; 105 } 106 107 /*** 108 * Sets the JDBC schema name to use in making a connection 109 */ 110 public void setSchemaName(String schemaName) { 111 this.schemaName = schemaName; 112 } 113 114 /*** 115 * The Ant-defined <code>execute</code> method must be implemented by subclasses. 116 */ 117 public abstract void execute(); 118 119 /* 120 * Constant Properties 121 */ 122 }

This page was automatically generated by Maven