Source Code Cross Referenced for Command.java in  » Database-JDBC-Connection-Pool » proxool » org » logicalcobwebs » dbscript » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » proxool » org.logicalcobwebs.dbscript 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This software is released under a licence similar to the Apache Software Licence.
003:         * See org.logicalcobwebs.proxool.package.html for details.
004:         * The latest version is available at http://proxool.sourceforge.net
005:         */
006:        package org.logicalcobwebs.dbscript;
007:
008:        import org.apache.commons.logging.Log;
009:        import org.apache.commons.logging.LogFactory;
010:
011:        /**
012:         * An SQL command that isrun by a {@link Script}. If {@link #getLoad load}
013:         * or {@link #getLoops loops} are configured then it might run more than
014:         * once.
015:         *
016:         * @version $Revision: 1.9 $, $Date: 2006/01/18 14:40:04 $
017:         * @author Bill Horsman (bill@logicalcobwebs.co.uk)
018:         * @author $Author: billhorsman $ (current maintainer)
019:         * @since Proxool 0.5
020:         */
021:        class Command implements  CommandIF {
022:
023:            private static final Log LOG = LogFactory.getLog(Command.class);
024:
025:            private String name;
026:
027:            private String sql;
028:
029:            private int load = 1;
030:
031:            private int loops = 1;
032:
033:            private String exception;
034:
035:            /**
036:             * If this command encounters an exception it will stop executing (and if
037:             * it is in a loop it will break out of the loop)
038:             */
039:            protected static final String EXCEPTION_STOP = "stop";
040:
041:            /**
042:             * If this command encounters an exception it will log it at DEBUG
043:             * level and continue
044:             */
045:            protected static final String EXCEPTION_LOG = "log";
046:
047:            /**
048:             * If this command encounters an exception it will silently ignore the
049:             * exception and continue. But it still calls the
050:             */
051:            protected static final String EXCEPTION_IGNORE = "ignore";
052:
053:            /**
054:             * @see CommandIF#getSql
055:             */
056:            public String getSql() {
057:                return sql;
058:            }
059:
060:            /**
061:             * @see #getSql
062:             */
063:            protected void setSql(String sql) {
064:                this .sql = sql;
065:            }
066:
067:            /**
068:             * @see CommandIF#getLoad
069:             */
070:            public int getLoad() {
071:                return load;
072:            }
073:
074:            /**
075:             * @see #getLoad
076:             */
077:            protected void setLoad(int load) {
078:                this .load = load;
079:            }
080:
081:            /**
082:             * @see CommandIF#getLoops
083:             */
084:            public int getLoops() {
085:                return loops;
086:            }
087:
088:            /**
089:             * @see #getLoops
090:             */
091:            protected void setLoops(int loops) {
092:                this .loops = loops;
093:            }
094:
095:            /**
096:             * @see CommandIF#isIgnoreException
097:             */
098:            public boolean isIgnoreException() {
099:                return exception != null && exception.equals(EXCEPTION_IGNORE);
100:            }
101:
102:            /**
103:             * @see CommandIF#isIgnoreException
104:             */
105:            public boolean isLogException() {
106:                return exception != null && exception.equals(EXCEPTION_LOG);
107:            }
108:
109:            /**
110:             * @see #isIgnoreException
111:             */
112:            public void setException(String exception) {
113:                if (exception == null) {
114:                    this .exception = EXCEPTION_STOP;
115:                    LOG.debug("Setting exception to default " + EXCEPTION_STOP);
116:                } else if (exception.equals(EXCEPTION_IGNORE)
117:                        || exception.equals(EXCEPTION_LOG)
118:                        || exception.equals(EXCEPTION_STOP)) {
119:                    this .exception = exception;
120:                    LOG.debug("Setting exception to " + exception);
121:                } else {
122:                    throw new RuntimeException("Unknown exception value: "
123:                            + exception);
124:                }
125:            }
126:
127:            /**
128:             * @see CommandIF#getName
129:             */
130:            public String getName() {
131:                return name;
132:            }
133:
134:            /**
135:             * @see #getName
136:             */
137:            public void setName(String name) {
138:                this .name = name;
139:            }
140:
141:        }
142:
143:        /*
144:         Revision history:
145:         $Log: Command.java,v $
146:         Revision 1.9  2006/01/18 14:40:04  billhorsman
147:         Unbundled Jakarta's Commons Logging.
148:
149:         Revision 1.8  2003/03/03 11:12:02  billhorsman
150:         fixed licence
151:
152:         Revision 1.7  2003/02/19 15:14:18  billhorsman
153:         fixed copyright (copy and paste error,
154:         not copyright change)
155:
156:         Revision 1.6  2003/02/06 17:41:01  billhorsman
157:         now uses imported logging
158:
159:         Revision 1.5  2002/11/09 15:58:12  billhorsman
160:         fix doc
161:
162:         Revision 1.4  2002/11/09 14:45:07  billhorsman
163:         now threaded and better exception handling
164:
165:         Revision 1.3  2002/11/06 21:07:03  billhorsman
166:         Now supports the CommandIF interface
167:
168:         Revision 1.2  2002/11/02 14:22:16  billhorsman
169:         Documentation
170:
171:         Revision 1.1  2002/11/02 11:29:53  billhorsman
172:         new script runner for testing
173:
174:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.