Source Code Cross Referenced for DBConnectionDefinitionImpl.java in  » IDE-Netbeans » sql.project » org » netbeans » modules » jdbcwizard » builder » dbmodel » impl » 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 » IDE Netbeans » sql.project » org.netbeans.modules.jdbcwizard.builder.dbmodel.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the terms of the Common Development
003:         * and Distribution License (the License). You may not use this file except in
004:         * compliance with the License.
005:         * 
006:         * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007:         * or http://www.netbeans.org/cddl.txt.
008:         * 
009:         * When distributing Covered Code, include this CDDL Header Notice in each file
010:         * and include the License file at http://www.netbeans.org/cddl.txt.
011:         * If applicable, add the following below the CDDL Header, with the fields
012:         * enclosed by brackets [] replaced by your own identifying information:
013:         * "Portions Copyrighted [year] [name of copyright owner]"
014:         * 
015:         * The Original Software is NetBeans. The Initial Developer of the Original
016:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017:         * Microsystems, Inc. All Rights Reserved.
018:         */
019:
020:        /*
021:         * 
022:         * Copyright 2005 Sun Microsystems, Inc.
023:         * 
024:         * Licensed under the Apache License, Version 2.0 (the "License");
025:         * you may not use this file except in compliance with the License.
026:         * You may obtain a copy of the License at
027:         * 
028:         * 	http://www.apache.org/licenses/LICENSE-2.0
029:         * 
030:         * Unless required by applicable law or agreed to in writing, software
031:         * distributed under the License is distributed on an "AS IS" BASIS,
032:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
033:         * See the License for the specific language governing permissions and
034:         * limitations under the License.
035:         * 
036:         */
037:        package org.netbeans.modules.jdbcwizard.builder.dbmodel.impl;
038:
039:        import java.util.ResourceBundle;
040:        import org.netbeans.modules.jdbcwizard.builder.dbmodel.DBConnectionDefinition;
041:        import org.openide.util.NbBundle;
042:
043:        /**
044:         * Implements DBConnectionDefinition interface for JDBC Database OTD.
045:         * 
046:         * @author
047:         */
048:        public class DBConnectionDefinitionImpl implements 
049:                DBConnectionDefinition {
050:
051:            private String name;
052:
053:            private String driverClass;
054:
055:            private String url;
056:
057:            private String userName;
058:
059:            private String password;
060:
061:            private String description;
062:
063:            private String dbType;
064:
065:            /**
066:             * Creates a new instance of DBConnectionDefinitionImpl with the given attributes.
067:             * 
068:             * @param connName connection name
069:             * @param driverName driver name
070:             * @param connUrl JDBC URL for this connection
071:             * @param uname username used to establish connection
072:             * @param passwd password used to establish connection
073:             * @param desc description of connection
074:             * @param type String concatenation of vendor and version number of source DB (e.g., "Oracle9",
075:             *            "JDBC11")
076:             */
077:            public DBConnectionDefinitionImpl(final String connName,
078:                    final String driverName, final String connUrl,
079:                    final String uname, final String passwd, final String desc,
080:                    final String type) {
081:                this .name = connName;
082:
083:                this .driverClass = driverName;
084:                this .url = connUrl;
085:                this .userName = uname;
086:                this .password = passwd;
087:                this .description = desc;
088:                this .dbType = type;
089:            }
090:
091:            /**
092:             * Creates a new instance of DBConnectionDefinitionImpl using the values in the given
093:             * DBConnectionDefinition.
094:             * 
095:             * @param connectionDefn DBConnectionDefinition to be copied
096:             */
097:            public DBConnectionDefinitionImpl(
098:                    final DBConnectionDefinition connectionDefn) {
099:                if (connectionDefn == null) {
100:                    final ResourceBundle cMessages = NbBundle
101:                            .getBundle(DBConnectionDefinitionImpl.class);
102:                    throw new IllegalArgumentException(cMessages
103:                            .getString("ERROR_NULL_DBCONNDEF")
104:                            + "ERROR_NULL_DBCONNDEF");// NO
105:                    // i18n
106:                }
107:
108:                this .copyFrom(connectionDefn);
109:            }
110:
111:            /**
112:             * @see com.stc.model.database.DBConnectionDefinition#getConnectionURL()
113:             */
114:            public String getConnectionURL() {
115:                return this .url;
116:            }
117:
118:            /**
119:             * Sets URL used to reference and establish a connection to the data source referenced in this
120:             * object.
121:             * 
122:             * @param newUrl URL pointing to the data source
123:             */
124:            public void setConnectionURL(final String newUrl) {
125:                this .url = newUrl;
126:            }
127:
128:            /**
129:             * Gets user-defined description, if any, for this DBConnectionDefinition.
130:             * 
131:             * @return user-defined description, possibly null if none was defined
132:             */
133:            public String getDescription() {
134:                return this .description;
135:            }
136:
137:            /**
138:             * @see com.stc.model.database.DatabaseModel#getDriverClass
139:             */
140:            public String getDriverClass() {
141:                return this .driverClass;
142:            }
143:
144:            /**
145:             * Sets fully-qualified class name of driver used to establish a connection to the data source
146:             * referenced in this object
147:             * 
148:             * @param newClass new fully-qualified driver class name
149:             */
150:            public void setDriverClass(final String newClass) {
151:                this .driverClass = newClass;
152:            }
153:
154:            /**
155:             * @see com.stc.model.database.DatabaseModel#getName
156:             */
157:            public String getName() {
158:                return this .name;
159:            }
160:
161:            /**
162:             * Sets new name for this DBConnectionDefinition.
163:             * 
164:             * @param newName new name for DBConnectionDefinition
165:             */
166:            public void setName(final String newName) {
167:                this .name = newName;
168:            }
169:
170:            /**
171:             * @see com.stc.model.database.DatabaseModel#getUserName
172:             */
173:            public String getUserName() {
174:                return this .userName;
175:            }
176:
177:            /**
178:             * Sets username used in authenticating a connection to the data source referenced in this
179:             * object.
180:             * 
181:             * @param newName new username, if any, to use for authentication purposes; may be null
182:             */
183:            public void setUserName(final String newName) {
184:                this .userName = newName;
185:            }
186:
187:            /**
188:             * @see com.stc.model.database.DatabaseModel#getPassword
189:             */
190:            public String getPassword() {
191:                return this .password;
192:            }
193:
194:            /**
195:             * Sets password used in authenticating a connection to the data source referenced in this
196:             * object.
197:             * 
198:             * @param newPw new password, if any, used for authentication purposes
199:             */
200:            public void setPassword(final String newPw) {
201:                this .password = newPw;
202:            }
203:
204:            /**
205:             * @see com.stc.model.database.DBConnectionDefinition#getDBType
206:             */
207:            public String getDBType() {
208:                return this .dbType;
209:            }
210:
211:            /**
212:             * Sets descriptive name of dbType of DB data source from which this metadata content was
213:             * derived, e.g., "Oracle9" for an Oracle 9i database, etc. Returns null if content was derived
214:             * from a non-DB source, such such as a flatfile.
215:             * 
216:             * @param newType vendor name of source database; null if derived from non-DB source
217:             */
218:            public void setType(final String newType) {
219:                this .dbType = newType;
220:            }
221:
222:            /**
223:             * Copies member values to those contained in the given DBConnectionDefinition instance. Does
224:             * shallow copy of properties and flatfiles collections.
225:             * 
226:             * @param source DBConnectionDefinition whose contents are to be copied into this instance
227:             */
228:            public synchronized void copyFrom(
229:                    final DBConnectionDefinition source) {
230:                if (source == null) {
231:                    final ResourceBundle cMessages = NbBundle
232:                            .getBundle(DBConnectionDefinitionImpl.class);
233:                    throw new IllegalArgumentException(cMessages
234:                            .getString("ERROR_NULL_REF")
235:                            + "(ERROR_NULL_REF)");
236:                } else if (source == this ) {
237:                    return;
238:                }
239:
240:                // classRef = source.getClassRef();
241:                this.description = source.getDescription();
242:                this.name = source.getName();
243:                this.dbType = source.getDBType();
244:                this.driverClass = source.getDriverClass();
245:                this.url = source.getConnectionURL();
246:                this.userName = source.getUserName();
247:                this.password = source.getPassword();
248:            }
249:
250:        }
w___w___w___.__j___av_a2_s_.___com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.