KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mysql > jdbc > ConnectionProperties


1 /*
2  Copyright (C) 2002-2004 MySQL AB
3
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of version 2 of the GNU General Public License as
6  published by the Free Software Foundation.
7
8  There are special exceptions to the terms and conditions of the GPL
9  as it is applied to this software. View the full text of the
10  exception in file EXCEPTIONS-CONNECTOR-J in the directory of this
11  software distribution.
12
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22
23
24  */

25 package com.mysql.jdbc;
26
27 import com.mysql.jdbc.log.Jdk14Logger;
28 import com.mysql.jdbc.log.Log;
29 import com.mysql.jdbc.log.Log4JLogger;
30 import com.mysql.jdbc.log.StandardLogger;
31
32 import java.io.UnsupportedEncodingException JavaDoc;
33
34 import java.sql.DriverPropertyInfo JavaDoc;
35 import java.sql.SQLException JavaDoc;
36
37 import java.util.ArrayList JavaDoc;
38 import java.util.HashMap JavaDoc;
39 import java.util.Iterator JavaDoc;
40 import java.util.Map JavaDoc;
41 import java.util.Properties JavaDoc;
42 import java.util.TreeMap JavaDoc;
43
44 import javax.naming.RefAddr JavaDoc;
45 import javax.naming.Reference JavaDoc;
46 import javax.naming.StringRefAddr JavaDoc;
47
48 /**
49  * Represents configurable properties for Connections and DataSources. Can also
50  * expose properties as JDBC DriverPropertyInfo if required as well.
51  *
52  * @author Mark Matthews
53  * @version $Id: ConnectionProperties.java,v 1.1.2.2 2005/05/17 14:58:56
54  * mmatthews Exp $
55  */

56 public class ConnectionProperties {
57     class BooleanConnectionProperty extends ConnectionProperty {
58         /**
59          * DOCUMENT ME!
60          *
61          * @param propertyNameToSet
62          * @param defaultValueToSet
63          * @param descriptionToSet
64          * DOCUMENT ME!
65          * @param sinceVersionToSet
66          * DOCUMENT ME!
67          */

68         BooleanConnectionProperty(String JavaDoc propertyNameToSet,
69                 boolean defaultValueToSet, String JavaDoc descriptionToSet,
70                 String JavaDoc sinceVersionToSet, String JavaDoc category, int orderInCategory) {
71             super(propertyNameToSet, new Boolean JavaDoc(defaultValueToSet), null, 0,
72                     0, descriptionToSet, sinceVersionToSet, category,
73                     orderInCategory);
74         }
75
76         /**
77          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#getAllowableValues()
78          */

79         String JavaDoc[] getAllowableValues() {
80             return new String JavaDoc[] { "true", "false", "yes", "no" };
81         }
82
83         boolean getValueAsBoolean() {
84             return ((Boolean JavaDoc) this.valueAsObject).booleanValue();
85         }
86
87         /**
88          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#hasValueConstraints()
89          */

90         boolean hasValueConstraints() {
91             return true;
92         }
93
94         /**
95          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#initializeFrom(java.util.Properties)
96          */

97         void initializeFrom(String JavaDoc extractedValue) throws SQLException JavaDoc {
98             if (extractedValue != null) {
99                 validateStringValues(extractedValue);
100
101                 this.valueAsObject = new Boolean JavaDoc(extractedValue
102                         .equalsIgnoreCase("TRUE")
103                         || extractedValue.equalsIgnoreCase("YES"));
104             } else {
105                 this.valueAsObject = this.defaultValue;
106             }
107         }
108
109         /**
110          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#isRangeBased()
111          */

112         boolean isRangeBased() {
113             return false;
114         }
115
116         void setValue(boolean valueFlag) {
117             this.valueAsObject = new Boolean JavaDoc(valueFlag);
118         }
119     }
120
121     abstract class ConnectionProperty extends DriverPropertyInfo JavaDoc {
122         String JavaDoc[] allowableValues;
123
124         String JavaDoc categoryName;
125
126         Object JavaDoc defaultValue;
127
128         int lowerBound;
129
130         int order;
131
132         String JavaDoc propertyName;
133
134         String JavaDoc sinceVersion;
135
136         int upperBound;
137
138         Object JavaDoc valueAsObject;
139
140         ConnectionProperty(String JavaDoc propertyNameToSet, Object JavaDoc defaultValueToSet,
141                 String JavaDoc[] allowableValuesToSet, int lowerBoundToSet,
142                 int upperBoundToSet, String JavaDoc descriptionToSet,
143                 String JavaDoc sinceVersionToSet, String JavaDoc category, int orderInCategory) {
144             super(propertyNameToSet, null);
145
146             this.description = descriptionToSet;
147             this.propertyName = propertyNameToSet;
148             this.defaultValue = defaultValueToSet;
149             this.valueAsObject = defaultValueToSet;
150             this.allowableValues = allowableValuesToSet;
151             this.lowerBound = lowerBoundToSet;
152             this.upperBound = upperBoundToSet;
153             this.required = false;
154             this.sinceVersion = sinceVersionToSet;
155             this.categoryName = category;
156             this.order = orderInCategory;
157         }
158
159         String JavaDoc[] getAllowableValues() {
160             return this.allowableValues;
161         }
162
163         /**
164          * @return Returns the categoryName.
165          */

166         String JavaDoc getCategoryName() {
167             return this.categoryName;
168         }
169
170         Object JavaDoc getDefaultValue() {
171             return this.defaultValue;
172         }
173
174         int getLowerBound() {
175             return this.lowerBound;
176         }
177
178         /**
179          * @return Returns the order.
180          */

181         int getOrder() {
182             return this.order;
183         }
184
185         String JavaDoc getPropertyName() {
186             return this.propertyName;
187         }
188
189         int getUpperBound() {
190             return this.upperBound;
191         }
192
193         Object JavaDoc getValueAsObject() {
194             return this.valueAsObject;
195         }
196
197         abstract boolean hasValueConstraints();
198
199         void initializeFrom(Properties JavaDoc extractFrom) throws SQLException JavaDoc {
200             String JavaDoc extractedValue = extractFrom.getProperty(getPropertyName());
201             extractFrom.remove(getPropertyName());
202             initializeFrom(extractedValue);
203         }
204
205         void initializeFrom(Reference JavaDoc ref) throws SQLException JavaDoc {
206             RefAddr JavaDoc refAddr = ref.get(getPropertyName());
207
208             if (refAddr != null) {
209                 String JavaDoc refContentAsString = (String JavaDoc) refAddr.getContent();
210
211                 initializeFrom(refContentAsString);
212             }
213         }
214
215         abstract void initializeFrom(String JavaDoc extractedValue) throws SQLException JavaDoc;
216
217         abstract boolean isRangeBased();
218
219         /**
220          * @param categoryName
221          * The categoryName to set.
222          */

223         void setCategoryName(String JavaDoc categoryName) {
224             this.categoryName = categoryName;
225         }
226
227         /**
228          * @param order
229          * The order to set.
230          */

231         void setOrder(int order) {
232             this.order = order;
233         }
234
235         void setValueAsObject(Object JavaDoc obj) {
236             this.valueAsObject = obj;
237         }
238
239         void storeTo(Reference JavaDoc ref) {
240             if (getValueAsObject() != null) {
241                 ref.add(new StringRefAddr JavaDoc(getPropertyName(), getValueAsObject()
242                         .toString()));
243             }
244         }
245
246         /**
247          * Synchronizes the state of a ConnectionProperty so that it can be
248          * exposed as a DriverPropertyInfo instance.
249          */

250         void syncDriverPropertyInfo() {
251             this.choices = getAllowableValues();
252             this.value = (this.valueAsObject != null) ? this.valueAsObject
253                     .toString() : null;
254         }
255
256         void validateStringValues(String JavaDoc valueToValidate) throws SQLException JavaDoc {
257             String JavaDoc[] validateAgainst = getAllowableValues();
258
259             if (valueToValidate == null) {
260                 return;
261             }
262
263             if ((validateAgainst == null) || (validateAgainst.length == 0)) {
264                 return;
265             }
266
267             for (int i = 0; i < validateAgainst.length; i++) {
268                 if ((validateAgainst[i] != null)
269                         && validateAgainst[i].equalsIgnoreCase(valueToValidate)) {
270                     return;
271                 }
272             }
273
274             StringBuffer JavaDoc errorMessageBuf = new StringBuffer JavaDoc();
275
276             errorMessageBuf.append("The connection property '");
277             errorMessageBuf.append(getPropertyName());
278             errorMessageBuf.append("' only accepts values of the form: ");
279
280             if (validateAgainst.length != 0) {
281                 errorMessageBuf.append("'");
282                 errorMessageBuf.append(validateAgainst[0]);
283                 errorMessageBuf.append("'");
284
285                 for (int i = 1; i < (validateAgainst.length - 1); i++) {
286                     errorMessageBuf.append(", ");
287                     errorMessageBuf.append("'");
288                     errorMessageBuf.append(validateAgainst[i]);
289                     errorMessageBuf.append("'");
290                 }
291
292                 errorMessageBuf.append(" or '");
293                 errorMessageBuf
294                         .append(validateAgainst[validateAgainst.length - 1]);
295                 errorMessageBuf.append("'");
296             }
297
298             errorMessageBuf.append(". The value '");
299             errorMessageBuf.append(valueToValidate);
300             errorMessageBuf.append("' is not in this set.");
301
302             throw new SQLException JavaDoc(errorMessageBuf.toString(),
303                     SQLError.SQL_STATE_ILLEGAL_ARGUMENT);
304         }
305     }
306
307     class IntegerConnectionProperty extends ConnectionProperty {
308         int multiplier = 1;
309
310         IntegerConnectionProperty(String JavaDoc propertyNameToSet,
311                 int defaultValueToSet, int lowerBoundToSet,
312                 int upperBoundToSet, String JavaDoc descriptionToSet,
313                 String JavaDoc sinceVersionToSet, String JavaDoc category, int orderInCategory) {
314             super(propertyNameToSet, new Integer JavaDoc(defaultValueToSet), null,
315                     lowerBoundToSet, upperBoundToSet, descriptionToSet,
316                     sinceVersionToSet, category, orderInCategory);
317         }
318
319         /**
320          * DOCUMENT ME!
321          *
322          * @param propertyNameToSet
323          * @param defaultValueToSet
324          * @param descriptionToSet
325          * @param sinceVersionToSet
326          * DOCUMENT ME!
327          */

328
329         IntegerConnectionProperty(String JavaDoc propertyNameToSet,
330                 int defaultValueToSet, String JavaDoc descriptionToSet,
331                 String JavaDoc sinceVersionToSet, String JavaDoc category, int orderInCategory) {
332             this(propertyNameToSet, defaultValueToSet, 0, 0, descriptionToSet,
333                     sinceVersionToSet, category, orderInCategory);
334         }
335
336         /**
337          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#getAllowableValues()
338          */

339         String JavaDoc[] getAllowableValues() {
340             return null;
341         }
342
343         /**
344          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#getLowerBound()
345          */

346         int getLowerBound() {
347             return this.lowerBound;
348         }
349
350         /**
351          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#getUpperBound()
352          */

353         int getUpperBound() {
354             return this.upperBound;
355         }
356
357         int getValueAsInt() {
358             return ((Integer JavaDoc) this.valueAsObject).intValue();
359         }
360
361         /**
362          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#hasValueConstraints()
363          */

364         boolean hasValueConstraints() {
365             return false;
366         }
367
368         /**
369          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#initializeFrom(java.lang.String)
370          */

371         void initializeFrom(String JavaDoc extractedValue) throws SQLException JavaDoc {
372             if (extractedValue != null) {
373                 try {
374                     // Parse decimals, too
375
int intValue = Double.valueOf(extractedValue).intValue();
376
377                     /*
378                      * if (isRangeBased()) { if ((intValue < getLowerBound()) ||
379                      * (intValue > getUpperBound())) { throw new
380                      * SQLException("The connection property '" +
381                      * getPropertyName() + "' only accepts integer values in the
382                      * range of " + getLowerBound() + " - " + getUpperBound() + ",
383                      * the value '" + extractedValue + "' exceeds this range.",
384                      * SQLError.SQL_STATE_ILLEGAL_ARGUMENT); } }
385                      */

386                     this.valueAsObject = new Integer JavaDoc(intValue * multiplier);
387                 } catch (NumberFormatException JavaDoc nfe) {
388                     throw new SQLException JavaDoc("The connection property '"
389                             + getPropertyName()
390                             + "' only accepts integer values. The value '"
391                             + extractedValue
392                             + "' can not be converted to an integer.",
393                             SQLError.SQL_STATE_ILLEGAL_ARGUMENT);
394                 }
395             } else {
396                 this.valueAsObject = this.defaultValue;
397             }
398         }
399
400         /**
401          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#isRangeBased()
402          */

403         boolean isRangeBased() {
404             return getUpperBound() != getLowerBound();
405         }
406
407         void setValue(int valueFlag) {
408             this.valueAsObject = new Integer JavaDoc(valueFlag);
409         }
410     }
411
412     class MemorySizeConnectionProperty extends IntegerConnectionProperty {
413
414         MemorySizeConnectionProperty(String JavaDoc propertyNameToSet,
415                 int defaultValueToSet, int lowerBoundToSet,
416                 int upperBoundToSet, String JavaDoc descriptionToSet,
417                 String JavaDoc sinceVersionToSet, String JavaDoc category, int orderInCategory) {
418             super(propertyNameToSet, defaultValueToSet, lowerBoundToSet,
419                     upperBoundToSet, descriptionToSet, sinceVersionToSet,
420                     category, orderInCategory);
421             // TODO Auto-generated constructor stub
422
}
423
424         void initializeFrom(String JavaDoc extractedValue) throws SQLException JavaDoc {
425             if (extractedValue != null) {
426                 if (extractedValue.endsWith("k")
427                         || extractedValue.endsWith("K")
428                         || extractedValue.endsWith("kb")
429                         || extractedValue.endsWith("Kb")
430                         || extractedValue.endsWith("kB")) {
431                     multiplier = 1024;
432                     int indexOfK = StringUtils.indexOfIgnoreCase(
433                             extractedValue, "k");
434                     extractedValue = extractedValue.substring(0, indexOfK);
435                 } else if (extractedValue.endsWith("m")
436                         || extractedValue.endsWith("M")
437                         || extractedValue.endsWith("G")
438                         || extractedValue.endsWith("mb")
439                         || extractedValue.endsWith("Mb")
440                         || extractedValue.endsWith("mB")) {
441                     multiplier = 1024 * 1024;
442                     int indexOfM = StringUtils.indexOfIgnoreCase(
443                             extractedValue, "m");
444                     extractedValue = extractedValue.substring(0, indexOfM);
445                 } else if (extractedValue.endsWith("g")
446                         || extractedValue.endsWith("G")
447                         || extractedValue.endsWith("gb")
448                         || extractedValue.endsWith("Gb")
449                         || extractedValue.endsWith("gB")) {
450                     multiplier = 1024 * 1024 * 1024;
451                     int indexOfG = StringUtils.indexOfIgnoreCase(
452                             extractedValue, "g");
453                     extractedValue = extractedValue.substring(0, indexOfG);
454                 }
455             }
456
457             super.initializeFrom(extractedValue);
458         }
459
460         void setValue(String JavaDoc value) throws SQLException JavaDoc {
461             initializeFrom(value);
462         }
463     }
464
465     class StringConnectionProperty extends ConnectionProperty {
466         StringConnectionProperty(String JavaDoc propertyNameToSet,
467                 String JavaDoc defaultValueToSet, String JavaDoc descriptionToSet,
468                 String JavaDoc sinceVersionToSet, String JavaDoc category, int orderInCategory) {
469             this(propertyNameToSet, defaultValueToSet, null, descriptionToSet,
470                     sinceVersionToSet, category, orderInCategory);
471         }
472
473         /**
474          * DOCUMENT ME!
475          *
476          * @param propertyNameToSet
477          * @param defaultValueToSet
478          * @param allowableValuesToSet
479          * @param descriptionToSet
480          * @param sinceVersionToSet
481          * DOCUMENT ME!
482          */

483         StringConnectionProperty(String JavaDoc propertyNameToSet,
484                 String JavaDoc defaultValueToSet, String JavaDoc[] allowableValuesToSet,
485                 String JavaDoc descriptionToSet, String JavaDoc sinceVersionToSet,
486                 String JavaDoc category, int orderInCategory) {
487             super(propertyNameToSet, defaultValueToSet, allowableValuesToSet,
488                     0, 0, descriptionToSet, sinceVersionToSet, category,
489                     orderInCategory);
490         }
491
492         String JavaDoc getValueAsString() {
493             return (String JavaDoc) this.valueAsObject;
494         }
495
496         /**
497          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#hasValueConstraints()
498          */

499         boolean hasValueConstraints() {
500             return (this.allowableValues != null)
501                     && (this.allowableValues.length > 0);
502         }
503
504         /**
505          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#initializeFrom(java.util.Properties)
506          */

507         void initializeFrom(String JavaDoc extractedValue) throws SQLException JavaDoc {
508             if (extractedValue != null) {
509                 validateStringValues(extractedValue);
510
511                 this.valueAsObject = extractedValue;
512             } else {
513                 this.valueAsObject = this.defaultValue;
514             }
515         }
516
517         /**
518          * @see com.mysql.jdbc.ConnectionProperties.ConnectionProperty#isRangeBased()
519          */

520         boolean isRangeBased() {
521             return false;
522         }
523
524         void setValue(String JavaDoc valueFlag) {
525             this.valueAsObject = valueFlag;
526         }
527     }
528
529     private static final String JavaDoc CONNECTION_AND_AUTH_CATEGORY = "Connection/Authentication";
530
531     private static final String JavaDoc DEBUGING_PROFILING_CATEGORY = "Debuging/Profiling";
532
533     private static final String JavaDoc HA_CATEGORY = "High Availability and Clustering";
534
535     private static final String JavaDoc MISC_CATEGORY = "Miscellaneous";
536
537     private static final String JavaDoc PERFORMANCE_CATEGORY = "Performance Extensions";
538
539     private static final ArrayList JavaDoc PROPERTY_LIST = new ArrayList JavaDoc();
540     
541     private static final String JavaDoc SECURITY_CATEGORY = "Security";
542
543     private static final String JavaDoc[] PROPERTY_CATEGORIES = new String JavaDoc[] {
544             CONNECTION_AND_AUTH_CATEGORY, HA_CATEGORY, SECURITY_CATEGORY,
545             PERFORMANCE_CATEGORY, DEBUGING_PROFILING_CATEGORY, MISC_CATEGORY };
546
547     private static final String JavaDoc STANDARD_LOGGER_NAME = StandardLogger.class
548             .getName();
549
550     protected static final String JavaDoc ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL = "convertToNull";
551
552     protected static final String JavaDoc ZERO_DATETIME_BEHAVIOR_EXCEPTION = "exception";
553
554     protected static final String JavaDoc ZERO_DATETIME_BEHAVIOR_ROUND = "round";
555
556     static {
557         try {
558             java.lang.reflect.Field JavaDoc[] declaredFields = ConnectionProperties.class
559                     .getDeclaredFields();
560
561             for (int i = 0; i < declaredFields.length; i++) {
562                 if (ConnectionProperties.ConnectionProperty.class
563                         .isAssignableFrom(declaredFields[i].getType())) {
564                     PROPERTY_LIST.add(declaredFields[i]);
565                 }
566             }
567         } catch (Exception JavaDoc ex) {
568             throw new RuntimeException JavaDoc(ex.toString());
569         }
570     }
571
572     /**
573      * Exposes all ConnectionPropertyInfo instances as DriverPropertyInfo
574      *
575      * @param info
576      * the properties to load into these ConnectionPropertyInfo
577      * instances
578      * @param slotsToReserve
579      * the number of DPI slots to reserve for 'standard' DPI
580      * properties (user, host, password, etc)
581      * @return a list of all ConnectionPropertyInfo instances, as
582      * DriverPropertyInfo
583      * @throws SQLException
584      * if an error occurs
585      */

586     protected static DriverPropertyInfo JavaDoc[] exposeAsDriverPropertyInfo(
587             Properties JavaDoc info, int slotsToReserve) throws SQLException JavaDoc {
588         return (new ConnectionProperties() {
589         }).exposeAsDriverPropertyInfoInternal(info, slotsToReserve);
590     }
591
592     private BooleanConnectionProperty allowLoadLocalInfile = new BooleanConnectionProperty(
593             "allowLoadLocalInfile",
594             true,
595             "Should the driver allow use of 'LOAD DATA LOCAL INFILE...' (defaults to 'true').",
596             "3.0.3", SECURITY_CATEGORY, Integer.MAX_VALUE);
597
598     private BooleanConnectionProperty allowMultiQueries = new BooleanConnectionProperty(
599             "allowMultiQueries",
600             false,
601             "Allow the use of ';' to delimit multiple queries during one statement (true/false, defaults to 'false'",
602             "3.1.1", SECURITY_CATEGORY, 1);
603
604     private BooleanConnectionProperty allowNanAndInf = new BooleanConnectionProperty(
605             "allowNanAndInf",
606             false,
607             "Should the driver allow NaN or +/- INF values in PreparedStatement.setDouble()?",
608             "3.1.5", MISC_CATEGORY, Integer.MIN_VALUE);
609
610     private BooleanConnectionProperty allowUrlInLocalInfile = new BooleanConnectionProperty(
611             "allowUrlInLocalInfile",
612             false,
613             "Should the driver allow URLs in 'LOAD DATA LOCAL INFILE' statements?",
614             "3.1.4", SECURITY_CATEGORY, Integer.MAX_VALUE);
615
616     private BooleanConnectionProperty alwaysSendSetIsolation = new BooleanConnectionProperty(
617             "alwaysSendSetIsolation",
618             true,
619             "Should the driver always communicate with the database when "
620                     + " Connection.setTransactionIsolation() is called? "
621                     + "If set to false, the driver will only communicate with the "
622                     + "database when the requested transaction isolation is different "
623                     + "than the whichever is newer, the last value that was set via "
624                     + "Connection.setTransactionIsolation(), or the value that was read from "
625                     + "the server when the connection was established.",
626             "3.1.7", PERFORMANCE_CATEGORY, Integer.MAX_VALUE);
627
628     private BooleanConnectionProperty autoDeserialize = new BooleanConnectionProperty(
629             "autoDeserialize",
630             false,
631             "Should the driver automatically detect and de-serialize objects stored in BLOB fields?",
632             "3.1.5", MISC_CATEGORY, Integer.MIN_VALUE);
633
634     private BooleanConnectionProperty autoGenerateTestcaseScript = new BooleanConnectionProperty(
635             "autoGenerateTestcaseScript", false,
636             "Should the driver dump the SQL it is executing, including server-side "
637                     + "prepared statements to STDERR?", "3.1.9",
638             DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
639
640     private boolean autoGenerateTestcaseScriptAsBoolean = false;
641
642     private BooleanConnectionProperty autoReconnect = new BooleanConnectionProperty(
643             "autoReconnect", false,
644             "Should the driver try to re-establish bad connections?", "1.1",
645             HA_CATEGORY, 0);
646
647     private BooleanConnectionProperty autoReconnectForPools = new BooleanConnectionProperty(
648             "autoReconnectForPools",
649             false,
650             "Use a reconnection strategy appropriate for connection pools (defaults to 'false')",
651             "3.1.3", HA_CATEGORY, 1);
652
653     private boolean autoReconnectForPoolsAsBoolean = false;
654
655     private MemorySizeConnectionProperty blobSendChunkSize = new MemorySizeConnectionProperty(
656             "blobSendChunkSize",
657             1024 * 1024,
658             1,
659             Integer.MAX_VALUE,
660             "Chunk to use when sending BLOB/CLOBs via ServerPreparedStatements",
661             "3.1.9", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
662
663     private BooleanConnectionProperty cacheCallableStatements = new BooleanConnectionProperty(
664             "cacheCallableStmts", false,
665             "Should the driver cache the parsing stage of CallableStatements",
666             "3.1.2", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
667
668     private BooleanConnectionProperty cachePreparedStatements = new BooleanConnectionProperty(
669             "cachePrepStmts",
670             false,
671             "Should the driver cache the parsing stage of PreparedStatements of client-side "
672                     + "prepared statements, the \"check\" for suitability of server-side prepared "
673                     + " and server-side prepared statements themselves?",
674             "3.0.10", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
675
676     private BooleanConnectionProperty cacheResultSetMetadata = new BooleanConnectionProperty(
677             "cacheResultSetMetadata",
678             false,
679             "Should the driver cache ResultSetMetaData for Statements and PreparedStatements? (Req. JDK-1.4+, true/false, default 'false')",
680             "3.1.1", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
681
682     private boolean cacheResultSetMetaDataAsBoolean;
683
684     private BooleanConnectionProperty cacheServerConfiguration = new BooleanConnectionProperty(
685             "cacheServerConfiguration",
686             false,
687             "Should the driver cache the results of "
688                     + "'SHOW VARIABLES' and 'SHOW COLLATION' on a per-URL basis?",
689             "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
690
691     private IntegerConnectionProperty callableStatementCacheSize = new IntegerConnectionProperty(
692             "callableStmtCacheSize",
693             100,
694             0,
695             Integer.MAX_VALUE,
696             "If 'cacheCallableStmts' is enabled, how many callable statements should be cached?",
697             "3.1.2", PERFORMANCE_CATEGORY, 5);
698
699     private BooleanConnectionProperty capitalizeTypeNames = new BooleanConnectionProperty(
700             "capitalizeTypeNames",
701             false,
702             "Capitalize type names in DatabaseMetaData? (usually only useful when using WebObjects, true/false, defaults to 'false')",
703             "2.0.7", MISC_CATEGORY, Integer.MIN_VALUE);
704
705     private StringConnectionProperty characterEncoding = new StringConnectionProperty(
706             "characterEncoding",
707             null,
708             "If 'useUnicode' is set to true, what character encoding should the driver use when dealing with strings? (defaults is to 'autodetect')",
709             "1.1g", MISC_CATEGORY, 5);
710
711     private String JavaDoc characterEncodingAsString = null;
712
713     private StringConnectionProperty characterSetResults = new StringConnectionProperty(
714             "characterSetResults", null,
715             "Character set to tell the server to return results as.", "3.0.13",
716             MISC_CATEGORY, 6);
717
718     private BooleanConnectionProperty clobberStreamingResults = new BooleanConnectionProperty(
719             "clobberStreamingResults",
720             false,
721             "This will cause a 'streaming' ResultSet to be automatically closed, "
722                     + "and any outstanding data still streaming from the server to be discarded if another query is executed "
723                     + "before all the data has been read from the server.",
724             "3.0.9", MISC_CATEGORY, Integer.MIN_VALUE);
725
726     private StringConnectionProperty connectionCollation = new StringConnectionProperty(
727             "connectionCollation",
728             null,
729             "If set, tells the server to use this collation via 'set connection_collation'",
730             "3.0.13", MISC_CATEGORY, 7);
731
732     private IntegerConnectionProperty connectTimeout = new IntegerConnectionProperty(
733             "connectTimeout", 0, 0, Integer.MAX_VALUE,
734             "Timeout for socket connect (in milliseconds), with 0 being no timeout. "
735                     + "Only works on JDK-1.4 or newer. Defaults to '0'.",
736             "3.0.1", CONNECTION_AND_AUTH_CATEGORY, 9);
737
738     private BooleanConnectionProperty continueBatchOnError = new BooleanConnectionProperty(
739             "continueBatchOnError",
740             true,
741             "Should the driver continue processing batch commands if "
742                     + "one statement fails. The JDBC spec allows either way (defaults to 'true').",
743             "3.0.3", MISC_CATEGORY, Integer.MIN_VALUE);
744
745     private BooleanConnectionProperty createDatabaseIfNotExist = new BooleanConnectionProperty(
746             "createDatabaseIfNotExist",
747             false,
748             "Creates the database given in the URL if it doesn't yet exist. Assumes "
749                     + " the configured user has permissions to create databases.",
750             "3.1.9", MISC_CATEGORY, Integer.MIN_VALUE);
751
752     private BooleanConnectionProperty detectServerPreparedStmts = new BooleanConnectionProperty(
753             "useServerPrepStmts",
754             true,
755             "Use server-side prepared statements if the server supports them? (defaults to 'true').",
756             "3.1.0", MISC_CATEGORY, Integer.MIN_VALUE);
757
758     private BooleanConnectionProperty dontTrackOpenResources = new BooleanConnectionProperty(
759             "dontTrackOpenResources",
760             false,
761             "The JDBC specification requires the driver to automatically track and close resources, "
762                     + "however if your application doesn't do a good job of "
763                     + "explicitly calling close() on statements or result sets, "
764                     + "this can cause memory leakage. Setting this property to true "
765                     + "relaxes this constraint, and can be more memory efficient for "
766                     + "some applications.", "3.1.7", PERFORMANCE_CATEGORY,
767             Integer.MIN_VALUE);
768
769     private BooleanConnectionProperty dumpQueriesOnException = new BooleanConnectionProperty(
770             "dumpQueriesOnException",
771             false,
772             "Should the driver dump the contents of the query sent to the server in the message for SQLExceptions?",
773             "3.1.3", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
774
775     private BooleanConnectionProperty dynamicCalendars = new BooleanConnectionProperty(
776             "dynamicCalendars",
777             false,
778             "Should the driver retrieve the default"
779                     + " calendar when required, or cache it per connection/session?",
780             "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
781
782     private BooleanConnectionProperty elideSetAutoCommits = new BooleanConnectionProperty(
783             "elideSetAutoCommits",
784             false,
785             "If using MySQL-4.1 or newer, should the driver only issue 'set autocommit=n' queries when the server's state doesn't match the requested state by Connection.setAutoCommit(boolean)?",
786             "3.1.3", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
787
788     private BooleanConnectionProperty emptyStringsConvertToZero = new BooleanConnectionProperty(
789             "emptyStringsConvertToZero", true,
790             "Should the driver allow conversions from empty string "
791                     + "fields to numeric values of '0'?", "3.1.8",
792             MISC_CATEGORY, Integer.MIN_VALUE);
793
794     private BooleanConnectionProperty emulateLocators = new BooleanConnectionProperty(
795             "emulateLocators", false, "N/A", "3.1.0", MISC_CATEGORY,
796             Integer.MIN_VALUE);
797
798     private BooleanConnectionProperty emulateUnsupportedPstmts = new BooleanConnectionProperty(
799             "emulateUnsupportedPstmts",
800             true,
801             "Should the driver detect prepared statements that are not supported by the server, and "
802                     + "replace them with client-side emulated versions?",
803             "3.1.7", MISC_CATEGORY, Integer.MIN_VALUE);
804
805     private BooleanConnectionProperty enableDeprecatedAutoreconnect = new BooleanConnectionProperty(
806             "enableDeprecatedAutoreconnect",
807             false,
808             "Auto-reconnect functionality is deprecated starting with version 3.2, and will be removed in version 3.3. Set this "
809                     + "property to 'true' to disable the check for the feature being configured.",
810             "3.2.1", HA_CATEGORY, Integer.MIN_VALUE);
811
812     private BooleanConnectionProperty enablePacketDebug = new BooleanConnectionProperty(
813             "enablePacketDebug",
814             false,
815             "When enabled, a ring-buffer of 'packetDebugBufferSize' packets will be kept, and dumped when exceptions are thrown in key areas in the driver's code",
816             "3.1.3", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
817
818     private BooleanConnectionProperty explainSlowQueries = new BooleanConnectionProperty(
819             "explainSlowQueries",
820             false,
821             "If 'logSlowQueries' is enabled, should the driver automatically issue an 'EXPLAIN' on the"
822                     + " server and send the results to the configured log at a WARN level?",
823             "3.1.2", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
824
825     /** When failed-over, set connection to read-only? */
826     private BooleanConnectionProperty failOverReadOnly = new BooleanConnectionProperty(
827             "failOverReadOnly",
828             true,
829             "When failing over in autoReconnect mode, should the connection be set to 'read-only'?",
830             "3.0.12", HA_CATEGORY, 2);
831
832     private BooleanConnectionProperty gatherPerformanceMetrics = new BooleanConnectionProperty(
833             "gatherPerfMetrics",
834             false,
835             "Should the driver gather performance metrics, and report them via the configured logger every 'reportMetricsIntervalMillis' milliseconds?",
836             "3.1.2", DEBUGING_PROFILING_CATEGORY, 1);
837
838     private boolean highAvailabilityAsBoolean = false;
839
840     private BooleanConnectionProperty holdResultsOpenOverStatementClose = new BooleanConnectionProperty(
841             "holdResultsOpenOverStatementClose",
842             false,
843             "Should the driver close result sets on Statement.close() as required by the JDBC specification?",
844             "3.1.7", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
845
846     private BooleanConnectionProperty ignoreNonTxTables = new BooleanConnectionProperty(
847             "ignoreNonTxTables",
848             false,
849             "Ignore non-transactional table warning for rollback? (defaults to 'false').",
850             "3.0.9", MISC_CATEGORY, Integer.MIN_VALUE);
851
852     private IntegerConnectionProperty initialTimeout = new IntegerConnectionProperty(
853             "initialTimeout", 2, 1, Integer.MAX_VALUE,
854             "If autoReconnect is enabled, the"
855                     + " initial time to wait between"
856                     + " re-connect attempts (in seconds, defaults to '2').",
857             "1.1", HA_CATEGORY, 5);
858
859     private BooleanConnectionProperty isInteractiveClient = new BooleanConnectionProperty(
860             "interactiveClient",
861             false,
862             "Set the CLIENT_INTERACTIVE flag, which tells MySQL "
863                     + "to timeout connections based on INTERACTIVE_TIMEOUT instead of WAIT_TIMEOUT",
864             "3.1.0", CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE);
865
866     private BooleanConnectionProperty jdbcCompliantTruncation = new BooleanConnectionProperty(
867             "jdbcCompliantTruncation",
868             true,
869             "Should the driver throw java.sql.DataTruncation"
870                     + " exceptions when data is truncated as is required by the JDBC specification when connected to a server that supports warnings"
871                     + "(MySQL 4.1.0 and newer)?", "3.1.2", MISC_CATEGORY,
872             Integer.MIN_VALUE);
873
874     private MemorySizeConnectionProperty locatorFetchBufferSize = new MemorySizeConnectionProperty(
875             "locatorFetchBufferSize",
876             1024 * 1024,
877             0,
878             Integer.MAX_VALUE,
879             "If 'emulateLocators' is configured to 'true', what size "
880                     + " buffer should be used when fetching BLOB data for getBinaryInputStream?",
881             "3.2.1", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
882
883     private StringConnectionProperty loggerClassName = new StringConnectionProperty(
884             "logger", STANDARD_LOGGER_NAME,
885             "The name of a class that implements '" + Log.class.getName()
886                     + "' that will be used to log messages to."
887                     + "(default is '" + STANDARD_LOGGER_NAME + "', which "
888                     + "logs to STDERR)", "3.1.1", DEBUGING_PROFILING_CATEGORY,
889             0);
890
891     private BooleanConnectionProperty logSlowQueries = new BooleanConnectionProperty(
892             "logSlowQueries",
893             false,
894             "Should queries that take longer than 'slowQueryThresholdMillis' be logged?",
895             "3.1.2", DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
896
897     private BooleanConnectionProperty maintainTimeStats = new BooleanConnectionProperty(
898             "maintainTimeStats",
899             true,
900             "Should the driver maintain various internal timers to enable "
901                     + "idle time calculations as well as more verbose error messages when "
902                     + "the connection to the server fails? Setting this property to "
903                     + "false removes at least two calls to System.getCurrentTimeMillis() "
904                     + "per query.", "3.1.9", PERFORMANCE_CATEGORY,
905             Integer.MAX_VALUE);
906
907     private boolean maintainTimeStatsAsBoolean = true;
908
909     private IntegerConnectionProperty maxQuerySizeToLog = new IntegerConnectionProperty(
910             "maxQuerySizeToLog",
911             2048,
912             0,
913             Integer.MAX_VALUE,
914             "Controls the maximum length/size of a query that will get logged when profiling or tracing",
915             "3.1.3", DEBUGING_PROFILING_CATEGORY, 4);
916
917     private IntegerConnectionProperty maxReconnects = new IntegerConnectionProperty(
918             "maxReconnects",
919             3,
920             1,
921             Integer.MAX_VALUE,
922             "Maximum number of reconnects to attempt if autoReconnect is true, default is '3'.",
923             "1.1", HA_CATEGORY, 4);
924
925     private IntegerConnectionProperty maxRows = new IntegerConnectionProperty(
926             "maxRows", -1, -1, Integer.MAX_VALUE,
927             "The maximum number of rows to return "
928                     + " (0, the default means return all rows).",
929             "all versions", MISC_CATEGORY, Integer.MIN_VALUE);
930
931     private int maxRowsAsInt = -1;
932
933     private IntegerConnectionProperty metadataCacheSize = new IntegerConnectionProperty(
934             "metadataCacheSize",
935             50,
936             1,
937             Integer.MAX_VALUE,
938             "The number of queries to cache"
939                     + "ResultSetMetadata for if cacheResultSetMetaData is set to 'true' (default 50)",
940             "3.1.1", PERFORMANCE_CATEGORY, 5);
941
942     private BooleanConnectionProperty noDatetimeStringSync = new BooleanConnectionProperty(
943             "noDatetimeStringSync",
944             false,
945             "Don't ensure that ResultSet.getDatetimeType().toString().equals(ResultSet.getString())",
946             "3.1.7", MISC_CATEGORY, Integer.MIN_VALUE);
947
948     private BooleanConnectionProperty nullCatalogMeansCurrent = new BooleanConnectionProperty(
949             "nullCatalogMeansCurrent",
950             true,
951             "When DatabaseMetadataMethods ask for a 'catalog' parameter, does the value null mean use the current catalog? "
952                     + "(this is not JDBC-compliant, but follows legacy behavior from earlier versions of the driver)",
953             "3.1.8", MISC_CATEGORY, Integer.MIN_VALUE);
954
955     private BooleanConnectionProperty nullNamePatternMatchesAll = new BooleanConnectionProperty(
956             "nullNamePatternMatchesAll",
957             true,
958             "Should DatabaseMetaData methods that accept *pattern parameters treat null the same as '%' "
959                     + " (this is not JDBC-compliant, however older versions of the driver accepted this departure from the specification)",
960             "3.1.8", MISC_CATEGORY, Integer.MIN_VALUE);
961
962     private IntegerConnectionProperty packetDebugBufferSize = new IntegerConnectionProperty(
963             "packetDebugBufferSize",
964             20,
965             0,
966             Integer.MAX_VALUE,
967             "The maximum number of packets to retain when 'enablePacketDebug' is true",
968             "3.1.3", DEBUGING_PROFILING_CATEGORY, 7);
969
970     private BooleanConnectionProperty paranoid = new BooleanConnectionProperty(
971             "paranoid",
972             false,
973             "Take measures to prevent exposure sensitive information in error messages and clear "
974                     + "data structures holding sensitive data when possible? (defaults to 'false')",
975             "3.0.1", SECURITY_CATEGORY, Integer.MIN_VALUE);
976
977     private BooleanConnectionProperty pedantic = new BooleanConnectionProperty(
978             "pedantic", false, "Follow the JDBC spec to the letter.", "3.0.0",
979             MISC_CATEGORY, Integer.MIN_VALUE);
980
981     private IntegerConnectionProperty preparedStatementCacheSize = new IntegerConnectionProperty(
982             "prepStmtCacheSize", 25, 0, Integer.MAX_VALUE,
983             "If prepared statement caching is enabled, "
984                     + "how many prepared statements should be cached?",
985             "3.0.10", PERFORMANCE_CATEGORY, 10);
986
987     private IntegerConnectionProperty preparedStatementCacheSqlLimit = new IntegerConnectionProperty(
988             "prepStmtCacheSqlLimit",
989             256,
990             1,
991             Integer.MAX_VALUE,
992             "If prepared statement caching is enabled, "
993                     + "what's the largest SQL the driver will cache the parsing for?",
994             "3.0.10", PERFORMANCE_CATEGORY, 11);
995
996     private StringConnectionProperty profileSql = new StringConnectionProperty(
997             "profileSql",
998             null,
999             "Deprecated, use 'profileSQL' instead. Trace queries and their execution/fetch times on STDERR (true/false) defaults to 'false'",
1000            "2.0.14", DEBUGING_PROFILING_CATEGORY, 3);
1001
1002    private BooleanConnectionProperty profileSQL = new BooleanConnectionProperty(
1003            "profileSQL",
1004            false,
1005            "Trace queries and their execution/fetch times to the configured logger (true/false) defaults to 'false'",
1006            "3.1.0", DEBUGING_PROFILING_CATEGORY, 1);
1007
1008    private boolean profileSQLAsBoolean = false;
1009
1010    private StringConnectionProperty propertiesTransform = new StringConnectionProperty(
1011            NonRegisteringDriver.PROPERTIES_TRANSFORM_KEY,
1012            null,
1013            "An implementation of com.mysql.jdbc.ConnectionPropertiesTransform that the driver will use to modify URL properties passed to the driver before attempting a connection",
1014            "3.1.4", CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE);
1015
1016    private IntegerConnectionProperty queriesBeforeRetryMaster = new IntegerConnectionProperty(
1017            "queriesBeforeRetryMaster",
1018            50,
1019            1,
1020            Integer.MAX_VALUE,
1021            "Number of queries to issue before falling back to master when failed over "
1022                    + "(when using multi-host failover). Whichever condition is met first, "
1023                    + "'queriesBeforeRetryMaster' or 'secondsBeforeRetryMaster' will cause an "
1024                    + "attempt to be made to reconnect to the master. Defaults to 50.",
1025            "3.0.2", HA_CATEGORY, 7);
1026
1027    private BooleanConnectionProperty reconnectAtTxEnd = new BooleanConnectionProperty(
1028            "reconnectAtTxEnd", false,
1029            "If autoReconnect is set to true, should the driver attempt reconnections"
1030                    + "at the end of every transaction?", "3.0.10",
1031            HA_CATEGORY, 4);
1032
1033    private boolean reconnectTxAtEndAsBoolean = false;
1034
1035    private BooleanConnectionProperty relaxAutoCommit = new BooleanConnectionProperty(
1036            "relaxAutoCommit",
1037            false,
1038            "If the version of MySQL the driver connects to does not support transactions, still allow calls to commit(), rollback() and setAutoCommit() (true/false, defaults to 'false')?",
1039            "2.0.13", MISC_CATEGORY, Integer.MIN_VALUE);
1040
1041    private IntegerConnectionProperty reportMetricsIntervalMillis = new IntegerConnectionProperty(
1042            "reportMetricsIntervalMillis",
1043            30000,
1044            0,
1045            Integer.MAX_VALUE,
1046            "If 'gatherPerfMetrics' is enabled, how often should they be logged (in ms)?",
1047            "3.1.2", DEBUGING_PROFILING_CATEGORY, 3);
1048
1049    private BooleanConnectionProperty requireSSL = new BooleanConnectionProperty(
1050            "requireSSL", false,
1051            "Require SSL connection if useSSL=true? (defaults to 'false').",
1052            "3.1.0", SECURITY_CATEGORY, 3);
1053
1054    private BooleanConnectionProperty rollbackOnPooledClose = new BooleanConnectionProperty(
1055            "rollbackOnPooledClose",
1056            true,
1057            "Should the driver issue a rollback() when the logical connection in a pool is closed?",
1058            "3.0.15", MISC_CATEGORY, Integer.MIN_VALUE);
1059
1060    private BooleanConnectionProperty roundRobinLoadBalance = new BooleanConnectionProperty(
1061            "roundRobinLoadBalance",
1062            false,
1063            "When autoReconnect is enabled, and failoverReadonly is false, should we pick hosts to connect to on a round-robin basis?",
1064            "3.1.2", HA_CATEGORY, 5);
1065
1066    private BooleanConnectionProperty runningCTS13 = new BooleanConnectionProperty(
1067            "runningCTS13",
1068            false,
1069            "Enables workarounds for bugs in Sun's JDBC compliance testsuite version 1.3",
1070            "3.1.7", MISC_CATEGORY, Integer.MIN_VALUE);
1071
1072    private IntegerConnectionProperty secondsBeforeRetryMaster = new IntegerConnectionProperty(
1073            "secondsBeforeRetryMaster",
1074            30,
1075            1,
1076            Integer.MAX_VALUE,
1077            "How long should the driver wait, when failed over, before attempting "
1078                    + "to reconnect to the master server? Whichever condition is met first, "
1079                    + "'queriesBeforeRetryMaster' or 'secondsBeforeRetryMaster' will cause an "
1080                    + "attempt to be made to reconnect to the master. Time in seconds, defaults to 30",
1081            "3.0.2", HA_CATEGORY, 8);
1082
1083    private StringConnectionProperty serverTimezone = new StringConnectionProperty(
1084            "serverTimezone",
1085            null,
1086            "Override detection/mapping of timezone. Used when timezone from server doesn't map to Java timezone",
1087            "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1088
1089    private StringConnectionProperty sessionVariables = new StringConnectionProperty(
1090            "sessionVariables", null,
1091            "A comma-separated list of name/value pairs to be sent as SET SESSION ... to "
1092                    + " the server when the driver connects.", "3.1.8",
1093            MISC_CATEGORY, Integer.MAX_VALUE);
1094
1095    private IntegerConnectionProperty slowQueryThresholdMillis = new IntegerConnectionProperty(
1096            "slowQueryThresholdMillis",
1097            2000,
1098            0,
1099            Integer.MAX_VALUE,
1100            "If 'logSlowQueries' is enabled, how long should a query (in ms) before it is logged as 'slow'?",
1101            "3.1.2", DEBUGING_PROFILING_CATEGORY, 9);
1102
1103    private StringConnectionProperty socketFactoryClassName = new StringConnectionProperty(
1104            "socketFactory",
1105            StandardSocketFactory.class.getName(),
1106            "The name of the class that the driver should use for creating socket connections to the server. This class must implement the interface 'com.mysql.jdbc.SocketFactory' and have public no-args constructor.",
1107            "3.0.3", CONNECTION_AND_AUTH_CATEGORY, 4);
1108
1109    private IntegerConnectionProperty socketTimeout = new IntegerConnectionProperty(
1110            "socketTimeout",
1111            0,
1112            0,
1113            Integer.MAX_VALUE,
1114            "Timeout on network socket operations (0, the default means no timeout).",
1115            "3.0.1", CONNECTION_AND_AUTH_CATEGORY, 10);
1116
1117    private BooleanConnectionProperty strictFloatingPoint = new BooleanConnectionProperty(
1118            "strictFloatingPoint", false,
1119            "Used only in older versions of compliance test", "3.0.0",
1120            MISC_CATEGORY, Integer.MIN_VALUE);
1121
1122    private BooleanConnectionProperty strictUpdates = new BooleanConnectionProperty(
1123            "strictUpdates",
1124            true,
1125            "Should the driver do strict checking (all primary keys selected) of updatable result sets (true, false, defaults to 'true')?",
1126            "3.0.4", MISC_CATEGORY, Integer.MIN_VALUE);
1127
1128    private BooleanConnectionProperty tinyInt1isBit = new BooleanConnectionProperty(
1129            "tinyInt1isBit",
1130            true,
1131            "Should the driver treat the datatype TINYINT(1) as the BIT type "
1132                    + "(because the server silently converts BIT -> TINYINT(1) when creating tables)?",
1133            "3.0.16", MISC_CATEGORY, Integer.MIN_VALUE);
1134
1135    private BooleanConnectionProperty traceProtocol = new BooleanConnectionProperty(
1136            "traceProtocol", false,
1137            "Should trace-level network protocol be logged?", "3.1.2",
1138            DEBUGING_PROFILING_CATEGORY, Integer.MIN_VALUE);
1139
1140    private BooleanConnectionProperty transformedBitIsBoolean = new BooleanConnectionProperty(
1141            "transformedBitIsBoolean",
1142            false,
1143            "If the driver converts TINYINT(1) to a different type, should it use BOOLEAN instead of BIT "
1144                    + " for future compatibility with MySQL-5.0, as MySQL-5.0 has a BIT type?",
1145            "3.1.9", MISC_CATEGORY, Integer.MIN_VALUE);
1146
1147    private BooleanConnectionProperty useCompression = new BooleanConnectionProperty(
1148            "useCompression",
1149            false,
1150            "Use zlib compression when communicating with the server (true/false)? Defaults to 'false'.",
1151            "3.0.17", CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE);
1152
1153    private StringConnectionProperty useConfig = new StringConnectionProperty(
1154            "useConfigs",
1155            null,
1156            "Load the comma-delimited list of configuration properties before parsing the "
1157                    + "URL or applying user-specified properties. These configurations are explained in the 'Configurations' of the documentation.",
1158            "3.1.5", CONNECTION_AND_AUTH_CATEGORY, Integer.MAX_VALUE);
1159
1160    private BooleanConnectionProperty useFastIntParsing = new BooleanConnectionProperty(
1161            "useFastIntParsing",
1162            true,
1163            "Use internal String->Integer conversion routines to avoid excessive object creation?",
1164            "3.1.4", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1165
1166    private BooleanConnectionProperty useHostsInPrivileges = new BooleanConnectionProperty(
1167            "useHostsInPrivileges",
1168            true,
1169            "Add '@hostname' to users in DatabaseMetaData.getColumn/TablePrivileges() (true/false), defaults to 'true'.",
1170            "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1171
1172    private BooleanConnectionProperty useLocalSessionState = new BooleanConnectionProperty(
1173            "useLocalSessionState",
1174            false,
1175            "Should the driver refer to the internal values of autocommit and transaction isolation that are set "
1176                    + " by Connection.setAutoCommit() and Connection.setTransactionIsolation(), rather than querying the database?",
1177            "3.1.7", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1178
1179    private BooleanConnectionProperty useNewIo = new BooleanConnectionProperty(
1180            "useNewIO",
1181            false,
1182            "Should the driver use the java.nio.* interfaces for network communication (true/false), defaults to 'false'",
1183            "3.1.0", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1184
1185    private BooleanConnectionProperty useOldUTF8Behavior = new BooleanConnectionProperty(
1186            "useOldUTF8Behavior",
1187            false,
1188            "Use the UTF-8 behavior the driver did when communicating with 4.0 and older servers",
1189            "3.1.6", MISC_CATEGORY, Integer.MIN_VALUE);
1190
1191    private boolean useOldUTF8BehaviorAsBoolean = false;
1192
1193    private BooleanConnectionProperty useOnlyServerErrorMessages = new BooleanConnectionProperty(
1194            "useOnlyServerErrorMessages",
1195            true,
1196            "Don't prepend 'standard' SQLState error messages to error messages returned by the server.",
1197            "3.0.15", MISC_CATEGORY, Integer.MIN_VALUE);
1198
1199    private BooleanConnectionProperty useReadAheadInput = new BooleanConnectionProperty(
1200            "useReadAheadInput",
1201            true,
1202            "Use newer, optimized non-blocking, buffered input stream when reading from the server?",
1203            "3.1.5", PERFORMANCE_CATEGORY, Integer.MIN_VALUE);
1204
1205    private BooleanConnectionProperty useSqlStateCodes = new BooleanConnectionProperty(
1206            "useSqlStateCodes",
1207            true,
1208            "Use SQL Standard state codes instead of 'legacy' X/Open/SQL state codes (true/false), default is 'true'",
1209            "3.1.3", MISC_CATEGORY, Integer.MIN_VALUE);
1210
1211    private BooleanConnectionProperty useSSL = new BooleanConnectionProperty(
1212            "useSSL",
1213            false,
1214            "Use SSL when communicating with the server (true/false), defaults to 'false'",
1215            "3.0.2", SECURITY_CATEGORY, 2);
1216
1217    private BooleanConnectionProperty useStreamLengthsInPrepStmts = new BooleanConnectionProperty(
1218            "useStreamLengthsInPrepStmts",
1219            true,
1220            "Honor stream length parameter in "
1221                    + "PreparedStatement/ResultSet.setXXXStream() method calls (true/false, defaults to 'true')?",
1222            "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1223
1224    private BooleanConnectionProperty useTimezone = new BooleanConnectionProperty(
1225            "useTimezone",
1226            false,
1227            "Convert time/date types between client and server timezones (true/false, defaults to 'false')?",
1228            "3.0.2", MISC_CATEGORY, Integer.MIN_VALUE);
1229
1230    private BooleanConnectionProperty useUltraDevWorkAround = new BooleanConnectionProperty(
1231            "ultraDevHack",
1232            false,
1233            "Create PreparedStatements for prepareCall() when required, because UltraDev "
1234                    + " is broken and issues a prepareCall() for _all_ statements? (true/false, defaults to 'false')",
1235            "2.0.3", MISC_CATEGORY, Integer.MIN_VALUE);
1236
1237    private BooleanConnectionProperty useUnbufferedInput = new BooleanConnectionProperty(
1238            "useUnbufferedInput", true,
1239            "Don't use BufferedInputStream for reading data from the server",
1240            "3.0.11", MISC_CATEGORY, Integer.MIN_VALUE);
1241
1242    private BooleanConnectionProperty useUnicode = new BooleanConnectionProperty(
1243            "useUnicode",
1244            false,
1245            "Should the driver use Unicode character encodings when handling strings? Should only be used when the driver can't determine the character set mapping, or you are trying to 'force' the driver to use a character set that MySQL either doesn't natively support (such as UTF-8), true/false, defaults to 'true'",
1246            "1.1g", MISC_CATEGORY, 0);
1247
1248    // Cache these values, they are 'hot'
1249
private boolean useUnicodeAsBoolean = true;
1250
1251    private BooleanConnectionProperty useUsageAdvisor = new BooleanConnectionProperty(
1252            "useUsageAdvisor",
1253            false,
1254            "Should the driver issue 'usage' warnings advising proper and efficient usage of JDBC and MySQL Connector/J to the log (true/false, defaults to 'false')?",
1255            "3.1.1", DEBUGING_PROFILING_CATEGORY, 10);
1256
1257    private boolean useUsageAdvisorAsBoolean = false;
1258
1259    private BooleanConnectionProperty yearIsDateType = new BooleanConnectionProperty(
1260            "yearIsDateType",
1261            true,
1262            "Should the JDBC driver treat the MySQL type \"YEAR\" as a java.sql.Date, or as a SHORT?",
1263            "3.1.9", MISC_CATEGORY, Integer.MIN_VALUE);
1264
1265    private StringConnectionProperty zeroDateTimeBehavior = new StringConnectionProperty(
1266            "zeroDateTimeBehavior",
1267            ZERO_DATETIME_BEHAVIOR_EXCEPTION,
1268            new String JavaDoc[] { ZERO_DATETIME_BEHAVIOR_EXCEPTION,
1269                    ZERO_DATETIME_BEHAVIOR_ROUND,
1270                    ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL },
1271            "What should happen when the driver encounters DATETIME values that are composed "
1272                    + "entirely of zeroes (used by MySQL to represent invalid dates)? "
1273                    + "Valid values are '"
1274                    + ZERO_DATETIME_BEHAVIOR_EXCEPTION
1275                    + "', '"
1276                    + ZERO_DATETIME_BEHAVIOR_ROUND
1277                    + "' and '"
1278                    + ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL + "'.", "3.1.4",
1279            MISC_CATEGORY, Integer.MIN_VALUE);
1280
1281    protected DriverPropertyInfo JavaDoc[] exposeAsDriverPropertyInfoInternal(
1282            Properties JavaDoc info, int slotsToReserve) throws SQLException JavaDoc {
1283        initializeProperties(info);
1284
1285        int numProperties = PROPERTY_LIST.size();
1286
1287        int listSize = numProperties + slotsToReserve;
1288
1289        DriverPropertyInfo JavaDoc[] driverProperties = new DriverPropertyInfo JavaDoc[listSize];
1290
1291        for (int i = slotsToReserve; i < listSize; i++) {
1292            java.lang.reflect.Field JavaDoc propertyField = (java.lang.reflect.Field JavaDoc) PROPERTY_LIST
1293                    .get(i - slotsToReserve);
1294
1295            try {
1296                ConnectionProperty propToExpose = (ConnectionProperty) propertyField
1297                        .get(this);
1298
1299                if (info != null) {
1300                    propToExpose.initializeFrom(info);
1301                }
1302
1303                propToExpose.syncDriverPropertyInfo();
1304                driverProperties[i] = propToExpose;
1305            } catch (IllegalAccessException JavaDoc iae) {
1306                throw new SQLException JavaDoc("Internal properties failure",
1307                        SQLError.SQL_STATE_GENERAL_ERROR);
1308            }
1309        }
1310
1311        return driverProperties;
1312    }
1313
1314    protected Properties JavaDoc exposeAsProperties(Properties JavaDoc info)
1315            throws SQLException JavaDoc {
1316        if (info == null) {
1317            info = new Properties JavaDoc();
1318        }
1319
1320        int numPropertiesToSet = PROPERTY_LIST.size();
1321
1322        for (int i = 0; i < numPropertiesToSet; i++) {
1323            java.lang.reflect.Field JavaDoc propertyField = (java.lang.reflect.Field JavaDoc) PROPERTY_LIST
1324                    .get(i);
1325
1326            try {
1327                ConnectionProperty propToGet = (ConnectionProperty) propertyField
1328                        .get(this);
1329
1330                Object JavaDoc propValue = propToGet.getValueAsObject();
1331
1332                if (propValue != null) {
1333                    info.setProperty(propToGet.getPropertyName(), propValue
1334                            .toString());
1335                }
1336            } catch (IllegalAccessException JavaDoc iae) {
1337                throw new SQLException JavaDoc("Internal properties failure",
1338                        SQLError.SQL_STATE_GENERAL_ERROR);
1339            }
1340        }
1341
1342        return info;
1343    }
1344
1345    /**
1346     * Returns a description of the connection properties as an XML document.
1347     *
1348     * @return the connection properties as an XML document.
1349     * @throws SQLException
1350     * if an error occurs.
1351     */

1352    public String JavaDoc exposeAsXml() throws SQLException JavaDoc {
1353        StringBuffer JavaDoc xmlBuf = new StringBuffer JavaDoc();
1354        xmlBuf.append("<ConnectionProperties>");
1355
1356        int numPropertiesToSet = PROPERTY_LIST.size();
1357
1358        int numCategories = PROPERTY_CATEGORIES.length;
1359
1360        Map JavaDoc propertyListByCategory = new HashMap JavaDoc();
1361
1362        for (int i = 0; i < numCategories; i++) {
1363            propertyListByCategory.put(PROPERTY_CATEGORIES[i], new Map JavaDoc[] {
1364                    new TreeMap JavaDoc(), new TreeMap JavaDoc() });
1365        }
1366
1367        //
1368
// The following properties are not exposed as 'normal' properties, but
1369
// they are
1370
// settable nonetheless, so we need to have them documented, make sure
1371
// that they sort 'first' as #1 and #2 in the category
1372
//
1373
StringConnectionProperty userProp = new StringConnectionProperty(
1374                NonRegisteringDriver.USER_PROPERTY_KEY, null,
1375                "The user to connect as", "all", CONNECTION_AND_AUTH_CATEGORY,
1376                Integer.MIN_VALUE + 1);
1377        StringConnectionProperty passwordProp = new StringConnectionProperty(
1378                NonRegisteringDriver.PASSWORD_PROPERTY_KEY, null,
1379                "The password to use when connecting", "all",
1380                CONNECTION_AND_AUTH_CATEGORY, Integer.MIN_VALUE + 2);
1381
1382        Map JavaDoc[] connectionSortMaps = (Map JavaDoc[]) propertyListByCategory
1383                .get(CONNECTION_AND_AUTH_CATEGORY);
1384        connectionSortMaps[0].put(new Integer JavaDoc(userProp.getOrder()), userProp);
1385        connectionSortMaps[0].put(new Integer JavaDoc(passwordProp.getOrder()),
1386                passwordProp);
1387
1388        try {
1389            for (int i = 0; i < numPropertiesToSet; i++) {
1390                java.lang.reflect.Field JavaDoc propertyField = (java.lang.reflect.Field JavaDoc) PROPERTY_LIST
1391                        .get(i);
1392                ConnectionProperty propToGet = (ConnectionProperty) propertyField
1393                        .get(this);
1394                Map JavaDoc[] sortMaps = (Map JavaDoc[]) propertyListByCategory.get(propToGet
1395                        .getCategoryName());
1396                int orderInCategory = propToGet.getOrder();
1397
1398                if (orderInCategory == Integer.MIN_VALUE) {
1399                    sortMaps[1].put(propToGet.getPropertyName(), propToGet);
1400                } else {
1401                    sortMaps[0].put(new Integer JavaDoc(orderInCategory), propToGet);
1402                }
1403            }
1404
1405            for (int j = 0; j < numCategories; j++) {
1406                Map JavaDoc[] sortMaps = (Map JavaDoc[]) propertyListByCategory
1407                        .get(PROPERTY_CATEGORIES[j]);
1408                Iterator JavaDoc orderedIter = sortMaps[0].values().iterator();
1409                Iterator JavaDoc alphaIter = sortMaps[1].values().iterator();
1410
1411                xmlBuf.append("\n <PropertyCategory name=\"");
1412                xmlBuf.append(PROPERTY_CATEGORIES[j]);
1413                xmlBuf.append("\">");
1414
1415                while (orderedIter.hasNext()) {
1416                    ConnectionProperty propToGet = (ConnectionProperty) orderedIter
1417                            .next();
1418                    propToGet.syncDriverPropertyInfo();
1419
1420                    xmlBuf.append("\n <Property name=\"");
1421                    xmlBuf.append(propToGet.getPropertyName());
1422                    xmlBuf.append("\" required=\"");
1423                    xmlBuf.append(propToGet.required ? "Yes" : "No");
1424
1425                    xmlBuf.append("\" default=\"");
1426
1427                    if (propToGet.getDefaultValue() != null) {
1428                        xmlBuf.append(propToGet.getDefaultValue());
1429                    }
1430
1431                    xmlBuf.append("\" sortOrder=\"");
1432                    xmlBuf.append(propToGet.getOrder());
1433                    xmlBuf.append("\" since=\"");
1434                    xmlBuf.append(propToGet.sinceVersion);
1435                    xmlBuf.append("\">\n");
1436                    xmlBuf.append(" ");
1437                    xmlBuf.append(propToGet.description);
1438                    xmlBuf.append("\n </Property>");
1439                }
1440
1441                while (alphaIter.hasNext()) {
1442                    ConnectionProperty propToGet = (ConnectionProperty) alphaIter
1443                            .next();
1444                    propToGet.syncDriverPropertyInfo();
1445
1446                    xmlBuf.append("\n <Property name=\"");
1447                    xmlBuf.append(propToGet.getPropertyName());
1448                    xmlBuf.append("\" required=\"");
1449                    xmlBuf.append(propToGet.required ? "Yes" : "No");
1450
1451                    xmlBuf.append("\" default=\"");
1452
1453                    if (propToGet.getDefaultValue() != null) {
1454                        xmlBuf.append(propToGet.getDefaultValue());
1455                    }
1456
1457                    xmlBuf.append("\" sortOrder=\"alpha\" since=\"");
1458                    xmlBuf.append(propToGet.sinceVersion);
1459                    xmlBuf.append("\">\n");
1460                    xmlBuf.append(" ");
1461                    xmlBuf.append(propToGet.description);
1462                    xmlBuf.append("\n </Property>");
1463                }
1464
1465                xmlBuf.append("\n </PropertyCategory>");
1466            }
1467        } catch (IllegalAccessException JavaDoc iae) {
1468            throw new SQLException JavaDoc("Internal properties failure",
1469                    SQLError.SQL_STATE_GENERAL_ERROR);
1470        }
1471
1472        xmlBuf.append("\n</ConnectionProperties>");
1473
1474        return xmlBuf.toString();
1475    }
1476
1477    /**
1478     * DOCUMENT ME!
1479     *
1480     * @return
1481     */

1482    public boolean getAllowLoadLocalInfile() {
1483        return this.allowLoadLocalInfile.getValueAsBoolean();
1484    }
1485
1486    /**
1487     * DOCUMENT ME!
1488     *
1489     * @return
1490     */

1491    public boolean getAllowMultiQueries() {
1492        return this.allowMultiQueries.getValueAsBoolean();
1493    }
1494
1495    /**
1496     * @return Returns the allowNanAndInf.
1497     */

1498    protected boolean getAllowNanAndInf() {
1499        return allowNanAndInf.getValueAsBoolean();
1500    }
1501
1502    /**
1503     * @return Returns the allowUrlInLocalInfile.
1504     */

1505    public boolean getAllowUrlInLocalInfile() {
1506        return this.allowUrlInLocalInfile.getValueAsBoolean();
1507    }
1508
1509    /**
1510     * @return Returns the alwaysSendSetIsolation.
1511     */

1512    public boolean getAlwaysSendSetIsolation() {
1513        return this.alwaysSendSetIsolation.getValueAsBoolean();
1514    }
1515
1516    /**
1517     * @return Returns the autoDeserialize.
1518     */

1519    public boolean getAutoDeserialize() {
1520        return autoDeserialize.getValueAsBoolean();
1521    }
1522
1523    public boolean getAutoGenerateTestcaseScript() {
1524        return this.autoGenerateTestcaseScriptAsBoolean;
1525    }
1526
1527    /**
1528     * DOCUMENT ME!
1529     *
1530     * @return
1531     */

1532    public boolean getAutoReconnectForPools() {
1533        return this.autoReconnectForPoolsAsBoolean;
1534    }
1535
1536    /**
1537     * @return Returns the blobSendChunkSize.
1538     */

1539    public int getBlobSendChunkSize() {
1540        return blobSendChunkSize.getValueAsInt();
1541    }
1542
1543    /**
1544     * DOCUMENT ME!
1545     *
1546     * @return Returns if cacheCallableStatements is enabled
1547     */

1548    public boolean getCacheCallableStatements() {
1549        return this.cacheCallableStatements.getValueAsBoolean();
1550    }
1551
1552    /**
1553     * DOCUMENT ME!
1554     *
1555     * @return Returns the cachePreparedStatements.
1556     */

1557    public boolean getCachePreparedStatements() {
1558        return ((Boolean JavaDoc) this.cachePreparedStatements.getValueAsObject())
1559                .booleanValue();
1560    }
1561
1562    /**
1563     * DOCUMENT ME!
1564     *
1565     * @return DOCUMENT ME!
1566     */

1567    public boolean getCacheResultSetMetadata() {
1568        return this.cacheResultSetMetaDataAsBoolean;
1569    }
1570
1571    /**
1572     * @return Returns the cacheServerConfiguration.
1573     */

1574    public boolean getCacheServerConfiguration() {
1575        return cacheServerConfiguration.getValueAsBoolean();
1576    }
1577
1578    /**
1579     * DOCUMENT ME!
1580     *
1581     * @return Returns the callableStatementCacheSize.
1582     */

1583    public int getCallableStatementCacheSize() {
1584        return this.callableStatementCacheSize.getValueAsInt();
1585    }
1586
1587    /**
1588     * DOCUMENT ME!
1589     *
1590     * @return
1591     */

1592    public boolean getCapitalizeTypeNames() {
1593        return this.capitalizeTypeNames.getValueAsBoolean();
1594    }
1595
1596    /**
1597     * DOCUMENT ME!
1598     *
1599     * @return Returns the characterSetResults.
1600     */

1601    public String JavaDoc getCharacterSetResults() {
1602        return this.characterSetResults.getValueAsString();
1603    }
1604
1605    /**
1606     * DOCUMENT ME!
1607     *
1608     * @return Returns the clobberStreamingResults.
1609     */

1610    public boolean getClobberStreamingResults() {
1611        return this.clobberStreamingResults.getValueAsBoolean();
1612    }
1613
1614    /**
1615     * DOCUMENT ME!
1616     *
1617     * @return Returns the connectionCollation.
1618     */

1619    public String JavaDoc getConnectionCollation() {
1620        return this.connectionCollation.getValueAsString();
1621    }
1622
1623    /**
1624     * DOCUMENT ME!
1625     *
1626     * @return
1627     */

1628    public int getConnectTimeout() {
1629        return this.connectTimeout.getValueAsInt();
1630    }
1631
1632    /**
1633     * DOCUMENT ME!
1634     *
1635     * @return
1636     */

1637    public boolean getContinueBatchOnError() {
1638        return this.continueBatchOnError.getValueAsBoolean();
1639    }
1640
1641    public boolean getCreateDatabaseIfNotExist() {
1642        return this.createDatabaseIfNotExist.getValueAsBoolean();
1643    }
1644
1645    /**
1646     * @return Returns the dontTrackOpenResources.
1647     */

1648    public boolean getDontTrackOpenResources() {
1649        return this.dontTrackOpenResources.getValueAsBoolean();
1650    }
1651
1652    /**
1653     * DOCUMENT ME!
1654     *
1655     * @return Returns the dumpQueriesOnException.
1656     */

1657    public boolean getDumpQueriesOnException() {
1658        return this.dumpQueriesOnException.getValueAsBoolean();
1659    }
1660
1661    /**
1662     * @return Returns the dynamicCalendars.
1663     */

1664    public boolean getDynamicCalendars() {
1665        return this.dynamicCalendars.getValueAsBoolean();
1666    }
1667
1668    /**
1669     * DOCUMENT ME!
1670     *
1671     * @return Returns the elideSetAutoCommits.
1672     */

1673    public boolean getElideSetAutoCommits() {
1674        return this.elideSetAutoCommits.getValueAsBoolean();
1675    }
1676
1677    public boolean getEmptyStringsConvertToZero() {
1678        return this.emptyStringsConvertToZero.getValueAsBoolean();
1679    }
1680
1681    /**
1682     * DOCUMENT ME!
1683     *
1684     * @return
1685     */

1686    public boolean getEmulateLocators() {
1687        return this.emulateLocators.getValueAsBoolean();
1688    }
1689
1690    /**
1691     * @return Returns the emulateUnsupportedPstmts.
1692     */

1693    public boolean getEmulateUnsupportedPstmts() {
1694        return this.emulateUnsupportedPstmts.getValueAsBoolean();
1695    }
1696
1697    /**
1698     * DOCUMENT ME!
1699     *
1700     * @return Returns the enablePacketDebug.
1701     */

1702    public boolean getEnablePacketDebug() {
1703        return this.enablePacketDebug.getValueAsBoolean();
1704    }
1705
1706    /**
1707     * DOCUMENT ME!
1708     *
1709     * @return
1710     */

1711    protected String JavaDoc getEncoding() {
1712        return this.characterEncodingAsString;
1713    }
1714
1715    /**
1716     * DOCUMENT ME!
1717     *
1718     * @return Returns the explainSlowQueries.
1719     */

1720    public boolean getExplainSlowQueries() {
1721        return this.explainSlowQueries.getValueAsBoolean();
1722    }
1723
1724    /**
1725     * DOCUMENT ME!
1726     *
1727     * @return Returns the failOverReadOnly.
1728     */

1729    public boolean getFailOverReadOnly() {
1730        return this.failOverReadOnly.getValueAsBoolean();
1731    }
1732
1733    /**
1734     * DOCUMENT ME!
1735     *
1736     * @return Returns the gatherPerformanceMetrics.
1737     */

1738    public boolean getGatherPerformanceMetrics() {
1739        return this.gatherPerformanceMetrics.getValueAsBoolean();
1740    }
1741
1742    /**
1743     * DOCUMENT ME!
1744     *
1745     * @return
1746     */

1747    protected boolean getHighAvailability() {
1748        return this.highAvailabilityAsBoolean;
1749    }
1750
1751    /**
1752     * @return Returns the holdResultsOpenOverStatementClose.
1753     */

1754    public boolean getHoldResultsOpenOverStatementClose() {
1755        return holdResultsOpenOverStatementClose.getValueAsBoolean();
1756    }
1757
1758    /**
1759     * DOCUMENT ME!
1760     *
1761     * @return
1762     */

1763    public boolean getIgnoreNonTxTables() {
1764        return this.ignoreNonTxTables.getValueAsBoolean();
1765    }
1766
1767    /**
1768     * DOCUMENT ME!
1769     *
1770     * @return
1771     */

1772    public int getInitialTimeout() {
1773        return this.initialTimeout.getValueAsInt();
1774    }
1775
1776    /**
1777     * DOCUMENT ME!
1778     *
1779     * @return
1780     */

1781    public boolean getInteractiveClient() {
1782        return this.isInteractiveClient.getValueAsBoolean();
1783    }
1784
1785    /**
1786     * DOCUMENT ME!
1787     *
1788     * @return Returns the isInteractiveClient.
1789     */

1790    public boolean getIsInteractiveClient() {
1791        return this.isInteractiveClient.getValueAsBoolean();
1792    }
1793
1794    /**
1795     * DOCUMENT ME!
1796     *
1797     * @return Returns the jdbcCompliantTruncation.
1798     */

1799    public boolean getJdbcCompliantTruncation() {
1800        return this.jdbcCompliantTruncation.getValueAsBoolean();
1801    }
1802
1803    /**
1804     * DOCUMENT ME!
1805     *
1806     * @return
1807     */

1808    public String JavaDoc getLogger() {
1809        return this.loggerClassName.getValueAsString();
1810    }
1811
1812    /**
1813     * DOCUMENT ME!
1814     *
1815     * @return Returns the loggerClassName.
1816     */

1817    public String JavaDoc getLoggerClassName() {
1818        return this.loggerClassName.getValueAsString();
1819    }
1820
1821    /**
1822     * DOCUMENT ME!
1823     *
1824     * @return Returns the logSlowQueries.
1825     */

1826    public boolean getLogSlowQueries() {
1827        return this.logSlowQueries.getValueAsBoolean();
1828    }
1829
1830    public boolean getMaintainTimeStats() {
1831        return maintainTimeStatsAsBoolean;
1832    }
1833
1834    /**
1835     * DOCUMENT ME!
1836     *
1837     * @return Returns the maxQuerySizeToLog.
1838     */

1839    public int getMaxQuerySizeToLog() {
1840        return this.maxQuerySizeToLog.getValueAsInt();
1841    }
1842
1843    /**
1844     * DOCUMENT ME!
1845     *
1846     * @return
1847     */

1848    public int getMaxReconnects() {
1849        return this.maxReconnects.getValueAsInt();
1850    }
1851
1852    /**
1853     * DOCUMENT ME!
1854     *
1855     * @return
1856     */

1857    public int getMaxRows() {
1858        return this.maxRowsAsInt;
1859    }
1860
1861    /**
1862     * Returns the number of queries that metadata can be cached if caching is
1863     * enabled.
1864     *
1865     * @return the number of queries to cache metadata for.
1866     */

1867    public int getMetadataCacheSize() {
1868        return this.metadataCacheSize.getValueAsInt();
1869    }
1870
1871    /**
1872     * @return Returns the noDatetimeStringSync.
1873     */

1874    public boolean getNoDatetimeStringSync() {
1875        return this.noDatetimeStringSync.getValueAsBoolean();
1876    }
1877
1878    public boolean getNullCatalogMeansCurrent() {
1879        return this.nullCatalogMeansCurrent.getValueAsBoolean();
1880    }
1881
1882    public boolean getNullNamePatternMatchesAll() {
1883        return this.nullNamePatternMatchesAll.getValueAsBoolean();
1884    }
1885
1886    /**
1887     * DOCUMENT ME!
1888     *
1889     * @return Returns the packetDebugBufferSize.
1890     */

1891    public int getPacketDebugBufferSize() {
1892        return this.packetDebugBufferSize.getValueAsInt();
1893    }
1894
1895    /**
1896     * DOCUMENT ME!
1897     *
1898     * @return
1899     */

1900    public boolean getParanoid() {
1901        return this.paranoid.getValueAsBoolean();
1902    }
1903
1904    /**
1905     * DOCUMENT ME!
1906     *
1907     * @return
1908     */

1909    public boolean getPedantic() {
1910        return this.pedantic.getValueAsBoolean();
1911    }
1912
1913    /**
1914     * DOCUMENT ME!
1915     *
1916     * @return Returns the preparedStatementCacheSize.
1917     */

1918    public int getPreparedStatementCacheSize() {
1919        return ((Integer JavaDoc) this.preparedStatementCacheSize.getValueAsObject())
1920                .intValue();
1921    }
1922
1923    /**
1924     * DOCUMENT ME!
1925     *
1926     * @return Returns the preparedStatementCacheSqlLimit.
1927     */

1928    public int getPreparedStatementCacheSqlLimit() {
1929        return ((Integer JavaDoc) this.preparedStatementCacheSqlLimit
1930                .getValueAsObject()).intValue();
1931    }
1932
1933    /**
1934     * DOCUMENT ME!
1935     *
1936     * @return
1937     */

1938    public boolean getProfileSql() {
1939        return this.profileSQLAsBoolean;
1940    }
1941
1942    /**
1943     * DOCUMENT ME!
1944     *
1945     * @return Returns the profileSQL flag
1946     */

1947    public boolean getProfileSQL() {
1948        return this.profileSQL.getValueAsBoolean();
1949    }
1950
1951    /**
1952     * @return Returns the propertiesTransform.
1953     */

1954    public String JavaDoc getPropertiesTransform() {
1955        return this.propertiesTransform.getValueAsString();
1956    }
1957
1958    /**
1959     * DOCUMENT ME!
1960     *
1961     * @return
1962     */

1963    public int getQueriesBeforeRetryMaster() {
1964        return this.queriesBeforeRetryMaster.getValueAsInt();
1965    }
1966
1967    /**
1968     * DOCUMENT ME!
1969     *
1970     * @return
1971     */

1972    public boolean getReconnectAtTxEnd() {
1973        return this.reconnectTxAtEndAsBoolean;
1974    }
1975
1976    /**
1977     * DOCUMENT ME!
1978     *
1979     * @return
1980     */

1981    public boolean getRelaxAutoCommit() {
1982        return this.relaxAutoCommit.getValueAsBoolean();
1983    }
1984
1985    /**
1986     * DOCUMENT ME!
1987     *
1988     * @return Returns the reportMetricsIntervalMillis.
1989     */

1990    public int getReportMetricsIntervalMillis() {
1991        return this.reportMetricsIntervalMillis.getValueAsInt();
1992    }
1993
1994    /**
1995     * DOCUMENT ME!
1996     *
1997     * @return
1998     */

1999    public boolean getRequireSSL() {
2000        return this.requireSSL.getValueAsBoolean();
2001    }
2002
2003    /**
2004     * @return Returns the rollbackOnPooledClose.
2005     */

2006    public boolean getRollbackOnPooledClose() {
2007        return this.rollbackOnPooledClose.getValueAsBoolean();
2008    }
2009
2010    /**
2011     * Returns whether or not hosts will be picked in a round-robin fashion.
2012     *
2013     * @return Returns the roundRobinLoadBalance property.
2014     */

2015    public boolean getRoundRobinLoadBalance() {
2016        return this.roundRobinLoadBalance.getValueAsBoolean();
2017    }
2018
2019    /**
2020     * @return Returns the runningCTS13.
2021     */

2022    public boolean getRunningCTS13() {
2023        return this.runningCTS13.getValueAsBoolean();
2024    }
2025
2026    /**
2027     * DOCUMENT ME!
2028     *
2029     * @return
2030     */

2031    public int getSecondsBeforeRetryMaster() {
2032        return this.secondsBeforeRetryMaster.getValueAsInt();
2033    }
2034
2035    /**
2036     * Returns the 'serverTimezone' property.
2037     *
2038     * @return the configured server timezone property.
2039     */

2040    public String JavaDoc getServerTimezone() {
2041        return this.serverTimezone.getValueAsString();
2042    }
2043
2044    /**
2045     * @return Returns the sessionVariables.
2046     */

2047    public String JavaDoc getSessionVariables() {
2048        return sessionVariables.getValueAsString();
2049    }
2050
2051    /**
2052     * DOCUMENT ME!
2053     *
2054     * @return Returns the slowQueryThresholdMillis.
2055     */

2056    public int getSlowQueryThresholdMillis() {
2057        return this.slowQueryThresholdMillis.getValueAsInt();
2058    }
2059
2060    /**
2061     * DOCUMENT ME!
2062     *
2063     * @return
2064     */

2065    public String JavaDoc getSocketFactoryClassName() {
2066        return this.socketFactoryClassName.getValueAsString();
2067    }
2068
2069    /**
2070     * DOCUMENT ME!
2071     *
2072     * @return
2073     */

2074    public int getSocketTimeout() {
2075        return this.socketTimeout.getValueAsInt();
2076    }
2077
2078    /**
2079     * DOCUMENT ME!
2080     *
2081     * @return
2082     */

2083    public boolean getStrictFloatingPoint() {
2084        return this.strictFloatingPoint.getValueAsBoolean();
2085    }
2086
2087    /**
2088     * DOCUMENT ME!
2089     *
2090     * @return
2091     */

2092    public boolean getStrictUpdates() {
2093        return this.strictUpdates.getValueAsBoolean();
2094    }
2095
2096    /**
2097     * @return Returns the tinyInt1isBit.
2098     */

2099    public boolean getTinyInt1isBit() {
2100        return this.tinyInt1isBit.getValueAsBoolean();
2101    }
2102
2103    /**
2104     * DOCUMENT ME!
2105     *
2106     * @return Returns the logProtocol.
2107     */

2108    public boolean getTraceProtocol() {
2109        return this.traceProtocol.getValueAsBoolean();
2110    }
2111
2112    public boolean getTransformedBitIsBoolean() {
2113        return this.transformedBitIsBoolean.getValueAsBoolean();
2114    }
2115
2116    /**
2117     * DOCUMENT ME!
2118     *
2119     * @return
2120     */

2121    public boolean getUseCompression() {
2122        return this.useCompression.getValueAsBoolean();
2123    }
2124
2125    /**
2126     * @return Returns the useFastIntParsing.
2127     */

2128    public boolean getUseFastIntParsing() {
2129        return this.useFastIntParsing.getValueAsBoolean();
2130    }
2131
2132    /**
2133     * DOCUMENT ME!
2134     *
2135     * @return
2136     */

2137    public boolean getUseHostsInPrivileges() {
2138        return this.useHostsInPrivileges.getValueAsBoolean();
2139    }
2140
2141    /**
2142     * @return Returns the useLocalSessionState.
2143     */

2144    public boolean getUseLocalSessionState() {
2145        return this.useLocalSessionState.getValueAsBoolean();
2146    }
2147
2148    /**
2149     * DOCUMENT ME!
2150     *
2151     * @return
2152     */

2153    public boolean getUseNewIo() {
2154        return this.useNewIo.getValueAsBoolean();
2155    }
2156
2157    /**
2158     * @return Returns the useOldUTF8Behavior.
2159     */

2160    public boolean getUseOldUTF8Behavior() {
2161        return this.useOldUTF8BehaviorAsBoolean;
2162    }
2163
2164    /**
2165     * @return Returns the useOnlyServerErrorMessages.
2166     */

2167    public boolean getUseOnlyServerErrorMessages() {
2168        return this.useOnlyServerErrorMessages.getValueAsBoolean();
2169    }
2170
2171    /**
2172     * @return Returns the useReadAheadInput.
2173     */

2174    public boolean getUseReadAheadInput() {
2175        return this.useReadAheadInput.getValueAsBoolean();
2176    }
2177
2178    /**
2179     * DOCUMENT ME!
2180     *
2181     * @return
2182     */

2183    public boolean getUseServerPreparedStmts() {
2184        return this.detectServerPreparedStmts.getValueAsBoolean();
2185    }
2186
2187    /**
2188     * DOCUMENT ME!
2189     *
2190     * @return Returns the useSqlStateCodes state.
2191     */

2192    public boolean getUseSqlStateCodes() {
2193        return this.useSqlStateCodes.getValueAsBoolean();
2194    }
2195
2196    /**
2197     * DOCUMENT ME!
2198     *
2199     * @return
2200     */

2201    public boolean getUseSSL() {
2202        return this.useSSL.getValueAsBoolean();
2203    }
2204
2205    /**
2206     * DOCUMENT ME!
2207     *
2208     * @return
2209     */

2210    public boolean getUseStreamLengthsInPrepStmts() {
2211        return this.useStreamLengthsInPrepStmts.getValueAsBoolean();
2212    }
2213
2214    /**
2215     * DOCUMENT ME!
2216     *
2217     * @return
2218     */

2219    public boolean getUseTimezone() {
2220        return this.useTimezone.getValueAsBoolean();
2221    }
2222
2223    /**
2224     * DOCUMENT ME!
2225     *
2226     * @return
2227     */

2228    public boolean getUseUltraDevWorkAround() {
2229        return this.useUltraDevWorkAround.getValueAsBoolean();
2230    }
2231
2232    /**
2233     * DOCUMENT ME!
2234     *
2235     * @return Returns the useUnbufferedInput.
2236     */

2237    public boolean getUseUnbufferedInput() {
2238        return this.useUnbufferedInput.getValueAsBoolean();
2239    }
2240
2241    /**
2242     * DOCUMENT ME!
2243     *
2244     * @return
2245     */

2246    public boolean getUseUnicode() {
2247        return this.useUnicodeAsBoolean;
2248    }
2249
2250    /**
2251     * Returns whether or not the driver advises of proper usage.
2252     *
2253     * @return the value of useUsageAdvisor
2254     */

2255    public boolean getUseUsageAdvisor() {
2256        return this.useUsageAdvisorAsBoolean;
2257    }
2258
2259    public boolean getYearIsDateType() {
2260        return this.yearIsDateType.getValueAsBoolean();
2261    }
2262
2263    /**
2264     * @return Returns the zeroDateTimeBehavior.
2265     */

2266    public String JavaDoc getZeroDateTimeBehavior() {
2267        return this.zeroDateTimeBehavior.getValueAsString();
2268    }
2269
2270    /**
2271     * Initializes driver properties that come from a JNDI reference (in the
2272     * case of a javax.sql.DataSource bound into some name service that doesn't
2273     * handle Java objects directly).
2274     *
2275     * @param ref
2276     * The JNDI Reference that holds RefAddrs for all properties
2277     * @throws SQLException
2278     * DOCUMENT ME!
2279     */

2280    protected void initializeFromRef(Reference JavaDoc ref) throws SQLException JavaDoc {
2281        int numPropertiesToSet = PROPERTY_LIST.size();
2282
2283        for (int i = 0; i < numPropertiesToSet; i++) {
2284            java.lang.reflect.Field JavaDoc propertyField = (java.lang.reflect.Field JavaDoc) PROPERTY_LIST
2285                    .get(i);
2286
2287            try {
2288                ConnectionProperty propToSet = (ConnectionProperty) propertyField
2289                        .get(this);
2290
2291                if (ref != null) {
2292                    propToSet.initializeFrom(ref);
2293                }
2294            } catch (IllegalAccessException JavaDoc iae) {
2295                throw new SQLException JavaDoc("Internal properties failure",
2296                        SQLError.SQL_STATE_GENERAL_ERROR);
2297            }
2298        }
2299
2300        postInitialization();
2301    }
2302
2303    /**
2304     * Initializes driver properties that come from URL or properties passed to
2305     * the driver manager.
2306     *
2307     * @param info
2308     * DOCUMENT ME!
2309     * @throws SQLException
2310     * DOCUMENT ME!
2311     */

2312    protected void initializeProperties(Properties JavaDoc info) throws SQLException JavaDoc {
2313        if (info != null) {
2314            // For backwards-compatibility
2315
String JavaDoc profileSqlLc = info.getProperty("profileSql");
2316
2317            if (profileSqlLc != null) {
2318                info.put("profileSQL", profileSqlLc);
2319            }
2320
2321            Properties JavaDoc infoCopy = (Properties JavaDoc) info.clone();
2322
2323            infoCopy.remove(NonRegisteringDriver.HOST_PROPERTY_KEY);
2324            infoCopy.remove(NonRegisteringDriver.USER_PROPERTY_KEY);
2325            infoCopy.remove(NonRegisteringDriver.PASSWORD_PROPERTY_KEY);
2326            infoCopy.remove(NonRegisteringDriver.DBNAME_PROPERTY_KEY);
2327            infoCopy.remove(NonRegisteringDriver.PORT_PROPERTY_KEY);
2328            infoCopy.remove("profileSql");
2329
2330            int numPropertiesToSet = PROPERTY_LIST.size();
2331
2332            for (int i = 0; i < numPropertiesToSet; i++) {
2333                java.lang.reflect.Field JavaDoc propertyField = (java.lang.reflect.Field JavaDoc) PROPERTY_LIST
2334                        .get(i);
2335
2336                try {
2337                    ConnectionProperty propToSet = (ConnectionProperty) propertyField
2338                            .get(this);
2339
2340                    propToSet.initializeFrom(infoCopy);
2341                } catch (IllegalAccessException JavaDoc iae) {
2342                    throw new SQLException JavaDoc(
2343                            "Unable to initialize driver properties due to "
2344                                    + iae.toString(),
2345                            SQLError.SQL_STATE_GENERAL_ERROR);
2346                }
2347            }
2348
2349            // TODO -- Not yet
2350
/*
2351             * int numUnknownProperties = infoCopy.size(); if
2352             * (numUnknownProperties > 0) { StringBuffer errorMessageBuf = new
2353             * StringBuffer( "Unknown connection ");
2354             * errorMessageBuf.append((numUnknownProperties == 1) ? "property " :
2355             * "properties "); Iterator propNamesItor =
2356             * infoCopy.keySet().iterator(); errorMessageBuf.append("'");
2357             * errorMessageBuf.append(propNamesItor.next().toString());
2358             * errorMessageBuf.append("'"); while (propNamesItor.hasNext()) {
2359             * errorMessageBuf.append(", '");
2360             * errorMessageBuf.append(propNamesItor.next().toString());
2361             * errorMessageBuf.append("'"); } throw new
2362             * SQLException(errorMessageBuf.toString(),
2363             * SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE); }
2364             */

2365            postInitialization();
2366        }
2367    }
2368
2369    protected void postInitialization() throws SQLException JavaDoc {
2370        /*
2371         * Configure logger If the value has been set by the user, then use
2372         * that, otherwise, autodetect it We prefer, Log4j, if it's available,
2373         * Then JDK1.4 logging, Then fallback to our STDERR logging.
2374         */

2375
2376        // Yes, this looks goofy (String == instead of .equals),
2377
// but it's how we tell whether we're using defaults
2378
// or not, and it survives JNDI/Properties initialization, etc.
2379
if (getLogger() == STANDARD_LOGGER_NAME) {
2380            String JavaDoc environmentLoggerName = null;
2381
2382            try {
2383                environmentLoggerName = System
2384                        .getProperty("com.mysql.jdbc.logger");
2385            } catch (Throwable JavaDoc noAccessToSystemProperties) {
2386                environmentLoggerName = null;
2387            }
2388
2389            if (environmentLoggerName != null) {
2390                setLogger(environmentLoggerName);
2391            } else {
2392                try {
2393                    // Is Log4J available?
2394
Class.forName("org.apache.log4j.Level");
2395                    setLogger(Log4JLogger.class.getName());
2396                } catch (Throwable JavaDoc t) {
2397                    try {
2398                        // Are we running on JDK-1.4?
2399
Class.forName("java.util.logging.Level");
2400                        setLogger(Jdk14Logger.class.getName());
2401                    } catch (Throwable JavaDoc t2) {
2402                        // guess not
2403
setLogger(STANDARD_LOGGER_NAME);
2404                    }
2405                }
2406            }
2407        }
2408
2409        // Support 'old' profileSql capitalization
2410
if (this.profileSql.getValueAsObject() != null) {
2411            this.profileSQL.initializeFrom(this.profileSql.getValueAsObject()
2412                    .toString());
2413        }
2414
2415        this.reconnectTxAtEndAsBoolean = ((Boolean JavaDoc) this.reconnectAtTxEnd
2416                .getValueAsObject()).booleanValue();
2417
2418        // Adjust max rows
2419
if (this.getMaxRows() == 0) {
2420            // adjust so that it will become MysqlDefs.MAX_ROWS
2421
// in execSQL()
2422
this.maxRows.setValueAsObject(new Integer JavaDoc(-1));
2423        }
2424
2425        //
2426
// Check character encoding
2427
//
2428
String JavaDoc testEncoding = this.getEncoding();
2429
2430        if (testEncoding != null) {
2431            // Attempt to use the encoding, and bail out if it
2432
// can't be used
2433
try {
2434                String JavaDoc testString = "abc";
2435                testString.getBytes(testEncoding);
2436            } catch (UnsupportedEncodingException JavaDoc UE) {
2437                throw new SQLException JavaDoc("Unsupported character " + "encoding '"
2438                        + testEncoding + "'.", "0S100");
2439            }
2440        }
2441
2442        // Metadata caching is only supported on JDK-1.4 and newer
2443
// because it relies on LinkedHashMap being present.
2444
// Check (and disable) if not supported
2445
if (((Boolean JavaDoc) this.cacheResultSetMetadata.getValueAsObject())
2446                .booleanValue()) {
2447            try {
2448                Class.forName("java.util.LinkedHashMap");
2449            } catch (ClassNotFoundException JavaDoc cnfe) {
2450                this.cacheResultSetMetadata.setValue(false);
2451            }
2452        }
2453
2454        this.cacheResultSetMetaDataAsBoolean = this.cacheResultSetMetadata
2455                .getValueAsBoolean();
2456        this.useUnicodeAsBoolean = this.useUnicode.getValueAsBoolean();
2457        this.characterEncodingAsString = ((String JavaDoc) this.characterEncoding
2458                .getValueAsObject());
2459        this.highAvailabilityAsBoolean = this.autoReconnect.getValueAsBoolean();
2460        this.autoReconnectForPoolsAsBoolean = this.autoReconnectForPools
2461                .getValueAsBoolean();
2462        this.maxRowsAsInt = ((Integer JavaDoc) this.maxRows.getValueAsObject())
2463                .intValue();
2464        this.profileSQLAsBoolean = this.profileSQL.getValueAsBoolean();
2465        this.useUsageAdvisorAsBoolean = this.useUsageAdvisor
2466                .getValueAsBoolean();
2467        this.useOldUTF8BehaviorAsBoolean = this.useOldUTF8Behavior
2468                .getValueAsBoolean();
2469        this.autoGenerateTestcaseScriptAsBoolean = this.autoGenerateTestcaseScript
2470                .getValueAsBoolean();
2471        this.maintainTimeStatsAsBoolean = this.maintainTimeStats
2472                .getValueAsBoolean();
2473    }
2474
2475    /**
2476     * DOCUMENT ME!
2477     *
2478     * @param property
2479     */

2480    public void setAllowLoadLocalInfile(boolean property) {
2481        this.allowLoadLocalInfile.setValue(property);
2482    }
2483
2484    /**
2485     * DOCUMENT ME!
2486     *
2487     * @param property
2488     */

2489    public void setAllowMultiQueries(boolean property) {
2490        this.allowMultiQueries.setValue(property);
2491    }
2492
2493    /**
2494     * @param allowNanAndInf
2495     * The allowNanAndInf to set.
2496     */

2497    protected void setAllowNanAndInf(boolean flag) {
2498        this.allowNanAndInf.setValue(flag);
2499    }
2500
2501    /**
2502     * @param allowUrlInLocalInfile
2503     * The allowUrlInLocalInfile to set.
2504     */

2505    public void setAllowUrlInLocalInfile(boolean flag) {
2506        this.allowUrlInLocalInfile.setValue(flag);
2507    }
2508
2509    /**
2510     * @param alwaysSendSetIsolation
2511     * The alwaysSendSetIsolation to set.
2512     */

2513    public void setAlwaysSendSetIsolation(boolean flag) {
2514        this.alwaysSendSetIsolation.setValue(flag);
2515    }
2516
2517    /**
2518     * @param autoDeserialize
2519     * The autoDeserialize to set.
2520     */

2521    public void setAutoDeserialize(boolean flag) {
2522        this.autoDeserialize.setValue(flag);
2523    }
2524
2525    public void setAutoGenerateTestcaseScript(boolean flag) {
2526        this.autoGenerateTestcaseScript.setValue(flag);
2527        this.autoGenerateTestcaseScriptAsBoolean = this.autoGenerateTestcaseScript
2528                .getValueAsBoolean();
2529    }
2530
2531    /**
2532     * DOCUMENT ME!
2533     *
2534     * @param flag
2535     * The autoReconnect to set.
2536     */

2537    public void setAutoReconnect(boolean flag) {
2538        this.autoReconnect.setValue(flag);
2539    }
2540
2541    /**
2542     * DOCUMENT ME!
2543     *
2544     * @param property
2545     */

2546    public void setAutoReconnectForConnectionPools(boolean property) {
2547        this.autoReconnectForPools.setValue(property);
2548        this.autoReconnectForPoolsAsBoolean = this.autoReconnectForPools
2549                .getValueAsBoolean();
2550    }
2551
2552    /**
2553     * DOCUMENT ME!
2554     *
2555     * @param flag
2556     * The autoReconnectForPools to set.
2557     */

2558    public void setAutoReconnectForPools(boolean flag) {
2559        this.autoReconnectForPools.setValue(flag);
2560    }
2561
2562    /**
2563     * @param blobSendChunkSize
2564     * The blobSendChunkSize to set.
2565     */

2566    public void setBlobSendChunkSize(String JavaDoc value) throws SQLException JavaDoc {
2567        this.blobSendChunkSize.setValue(value);
2568    }
2569
2570    /**
2571     * DOCUMENT ME!
2572     *
2573     * @param flag
2574     * The cacheCallableStatements to set.
2575     */

2576    public void setCacheCallableStatements(boolean flag) {
2577        this.cacheCallableStatements.setValue(flag);
2578    }
2579
2580    /**
2581     * DOCUMENT ME!
2582     *
2583     * @param flag
2584     * The cachePreparedStatements to set.
2585     */

2586    public void setCachePreparedStatements(boolean flag) {
2587        this.cachePreparedStatements.setValue(flag);
2588    }
2589
2590    /**
2591     * Sets whether or not we should cache result set metadata.
2592     *
2593     * @param property
2594     */

2595    public void setCacheResultSetMetadata(boolean property) {
2596        this.cacheResultSetMetadata.setValue(property);
2597        this.cacheResultSetMetaDataAsBoolean = this.cacheResultSetMetadata
2598                .getValueAsBoolean();
2599    }
2600
2601    /**
2602     * @param cacheServerConfiguration
2603     * The cacheServerConfiguration to set.
2604     */

2605    public void setCacheServerConfiguration(boolean flag) {
2606        this.cacheServerConfiguration.setValue(flag);
2607    }
2608
2609    /**
2610     * Configures the number of callable statements to cache. (this is
2611     * configurable during the life of the connection).
2612     *
2613     * @param size
2614     * The callableStatementCacheSize to set.
2615     */

2616    public void setCallableStatementCacheSize(int size) {
2617        this.callableStatementCacheSize.setValue(size);
2618    }
2619
2620    /**
2621     * DOCUMENT ME!
2622     *
2623     * @param property
2624     */

2625    public void setCapitalizeDBMDTypes(boolean property) {
2626        this.capitalizeTypeNames.setValue(property);
2627    }
2628
2629    /**
2630     * DOCUMENT ME!
2631     *
2632     * @param flag
2633     * The capitalizeTypeNames to set.
2634     */

2635    public void setCapitalizeTypeNames(boolean flag) {
2636        this.capitalizeTypeNames.setValue(flag);
2637    }
2638
2639    /**
2640     * DOCUMENT ME!
2641     *
2642     * @param encoding
2643     * The characterEncoding to set.
2644     */

2645    public void setCharacterEncoding(String JavaDoc encoding) {
2646        this.characterEncoding.setValue(encoding);
2647    }
2648
2649    /**
2650     * DOCUMENT ME!
2651     *
2652     * @param characterSet
2653     * The characterSetResults to set.
2654     */

2655    public void setCharacterSetResults(String JavaDoc characterSet) {
2656        this.characterSetResults.setValue(characterSet);
2657    }
2658
2659    /**
2660     * DOCUMENT ME!
2661     *
2662     * @param flag
2663     * The clobberStreamingResults to set.
2664     */

2665    public void setClobberStreamingResults(boolean flag) {
2666        this.clobberStreamingResults.setValue(flag);
2667    }
2668
2669    /**
2670     * DOCUMENT ME!
2671     *
2672     * @param collation
2673     * The connectionCollation to set.
2674     */

2675    public void setConnectionCollation(String JavaDoc collation) {
2676        this.connectionCollation.setValue(collation);
2677    }
2678
2679    /**
2680     * DOCUMENT ME!
2681     *
2682     * @param timeoutMs
2683     */

2684    public void setConnectTimeout(int timeoutMs) {
2685        this.connectTimeout.setValue(timeoutMs);
2686    }
2687
2688    /**
2689     * DOCUMENT ME!
2690     *
2691     * @param property
2692     */

2693    public void setContinueBatchOnError(boolean property) {
2694        this.continueBatchOnError.setValue(property);
2695    }
2696
2697    public void setCreateDatabaseIfNotExist(boolean flag) {
2698        this.createDatabaseIfNotExist.setValue(flag);
2699    }
2700
2701    /**
2702     * DOCUMENT ME!
2703     *
2704     * @param property
2705     */

2706    public void setDetectServerPreparedStmts(boolean property) {
2707        this.detectServerPreparedStmts.setValue(property);
2708    }
2709
2710    /**
2711     * @param dontTrackOpenResources
2712     * The dontTrackOpenResources to set.
2713     */

2714    public void setDontTrackOpenResources(boolean flag) {
2715        this.dontTrackOpenResources.setValue(flag);
2716    }
2717
2718    /**
2719     * DOCUMENT ME!
2720     *
2721     * @param flag
2722     * The dumpQueriesOnException to set.
2723     */

2724    public void setDumpQueriesOnException(boolean flag) {
2725        this.dumpQueriesOnException.setValue(flag);
2726    }
2727
2728    /**
2729     * @param dynamicCalendars
2730     * The dynamicCalendars to set.
2731     */

2732    public void setDynamicCalendars(boolean flag) {
2733        this.dynamicCalendars.setValue(flag);
2734    }
2735
2736    /**
2737     * DOCUMENT ME!
2738     *
2739     * @param flag
2740     * The elideSetAutoCommits to set.
2741     */

2742    public void setElideSetAutoCommits(boolean flag) {
2743        this.elideSetAutoCommits.setValue(flag);
2744    }
2745
2746    public void setEmptyStringsConvertToZero(boolean flag) {
2747        this.emptyStringsConvertToZero.setValue(flag);
2748    }
2749
2750    /**
2751     * DOCUMENT ME!
2752     *
2753     * @param property
2754     */

2755    public void setEmulateLocators(boolean property) {
2756        this.emulateLocators.setValue(property);
2757    }
2758
2759    /**
2760     * @param emulateUnsupportedPstmts
2761     * The emulateUnsupportedPstmts to set.
2762     */

2763    public void setEmulateUnsupportedPstmts(boolean flag) {
2764        this.emulateUnsupportedPstmts.setValue(flag);
2765    }
2766
2767    /**
2768     * DOCUMENT ME!
2769     *
2770     * @param flag
2771     * The enablePacketDebug to set.
2772     */

2773    public void setEnablePacketDebug(boolean flag) {
2774        this.enablePacketDebug.setValue(flag);
2775    }
2776
2777    /**
2778     * DOCUMENT ME!
2779     *
2780     * @param property
2781     */

2782    public void setEncoding(String JavaDoc property) {
2783        this.characterEncoding.setValue(property);
2784        this.characterEncodingAsString = this.characterEncoding
2785                .getValueAsString();
2786    }
2787
2788    /**
2789     * DOCUMENT ME!
2790     *
2791     * @param flag
2792     * The explainSlowQueries to set.
2793     */

2794    public void setExplainSlowQueries(boolean flag) {
2795        this.explainSlowQueries.setValue(flag);
2796    }
2797
2798    /**
2799     * DOCUMENT ME!
2800     *
2801     * @param flag
2802     * The failOverReadOnly to set.
2803     */

2804    public void setFailOverReadOnly(boolean flag) {
2805        this.failOverReadOnly.setValue(flag);
2806    }
2807
2808    /**
2809     * DOCUMENT ME!
2810     *
2811     * @param flag
2812     * The gatherPerformanceMetrics to set.
2813     */

2814    public void setGatherPerformanceMetrics(boolean flag) {
2815        this.gatherPerformanceMetrics.setValue(flag);
2816    }
2817
2818    /**
2819     * DOCUMENT ME!
2820     *
2821     * @param property
2822     */

2823    protected void setHighAvailability(boolean property) {
2824        this.autoReconnect.setValue(property);
2825        this.highAvailabilityAsBoolean = this.autoReconnect.getValueAsBoolean();
2826    }
2827
2828    /**
2829     * @param holdResultsOpenOverStatementClose
2830     * The holdResultsOpenOverStatementClose to set.
2831     */

2832    public void setHoldResultsOpenOverStatementClose(boolean flag) {
2833        this.holdResultsOpenOverStatementClose.setValue(flag);
2834    }
2835
2836    /**
2837     * DOCUMENT ME!
2838     *
2839     * @param property
2840     */

2841    public void setIgnoreNonTxTables(boolean property) {
2842        this.ignoreNonTxTables.setValue(property);
2843    }
2844
2845    /**
2846     * DOCUMENT ME!
2847     *
2848     * @param property
2849     */

2850    public void setInitialTimeout(int property) {
2851        this.initialTimeout.setValue(property);
2852    }
2853
2854    /**
2855     * DOCUMENT ME!
2856     *
2857     * @param property
2858     */

2859    public void setIsInteractiveClient(boolean property) {
2860        this.isInteractiveClient.setValue(property);
2861    }
2862
2863    /**
2864     * DOCUMENT ME!
2865     *
2866     * @param flag
2867     * The jdbcCompliantTruncation to set.
2868     */

2869    public void setJdbcCompliantTruncation(boolean flag) {
2870        this.jdbcCompliantTruncation.setValue(flag);
2871    }
2872
2873    /**
2874     * DOCUMENT ME!
2875     *
2876     * @param property
2877     */

2878    public void setLogger(String JavaDoc property) {
2879        this.loggerClassName.setValueAsObject(property);
2880    }
2881
2882    /**
2883     * DOCUMENT ME!
2884     *
2885     * @param className
2886     * The loggerClassName to set.
2887     */

2888    public void setLoggerClassName(String JavaDoc className) {
2889        this.loggerClassName.setValue(className);
2890    }
2891
2892    /**
2893     * DOCUMENT ME!
2894     *
2895     * @param flag
2896     * The logSlowQueries to set.
2897     */

2898    public void setLogSlowQueries(boolean flag) {
2899        this.logSlowQueries.setValue(flag);
2900    }
2901
2902    public void setMaintainTimeStats(boolean flag) {
2903        this.maintainTimeStats.setValue(flag);
2904        this.maintainTimeStatsAsBoolean = this.maintainTimeStats
2905                .getValueAsBoolean();
2906    }
2907
2908    /**
2909     * DOCUMENT ME!
2910     *
2911     * @param sizeInBytes
2912     * The maxQuerySizeToLog to set.
2913     */

2914    public void setMaxQuerySizeToLog(int sizeInBytes) {
2915        this.maxQuerySizeToLog.setValue(sizeInBytes);
2916    }
2917
2918    /**
2919     * DOCUMENT ME!
2920     *
2921     * @param property
2922     */

2923    public void setMaxReconnects(int property) {
2924        this.maxReconnects.setValue(property);
2925    }
2926
2927    /**
2928     * DOCUMENT ME!
2929     *
2930     * @param property
2931     */

2932    public void setMaxRows(int property) {
2933        this.maxRows.setValue(property);
2934        this.maxRowsAsInt = this.maxRows.getValueAsInt();
2935    }
2936
2937    /**
2938     * Sets the number of queries that metadata can be cached if caching is
2939     * enabled.
2940     *
2941     * @param value
2942     * the number of queries to cache metadata for.
2943     */

2944    public void setMetadataCacheSize(int value) {
2945        this.metadataCacheSize.setValue(value);
2946    }
2947
2948    /**
2949     * @param noDatetimeStringSync
2950     * The noDatetimeStringSync to set.
2951     */

2952    public void setNoDatetimeStringSync(boolean flag) {
2953        this.noDatetimeStringSync.setValue(flag);
2954    }
2955
2956    public void setNullCatalogMeansCurrent(boolean value) {
2957        this.nullCatalogMeansCurrent.setValue(value);
2958    }
2959
2960    public void setNullNamePatternMatchesAll(boolean value) {
2961        this.nullNamePatternMatchesAll.setValue(value);
2962    }
2963
2964    /**
2965     * DOCUMENT ME!
2966     *
2967     * @param size
2968     * The packetDebugBufferSize to set.
2969     */

2970    public void setPacketDebugBufferSize(int size) {
2971        this.packetDebugBufferSize.setValue(size);
2972    }
2973
2974    /**
2975     * DOCUMENT ME!
2976     *
2977     * @param property
2978     */

2979    public void setParanoid(boolean property) {
2980        this.paranoid.setValue(property);
2981    }
2982
2983    /**
2984     * DOCUMENT ME!
2985     *
2986     * @param property
2987     */

2988    public void setPedantic(boolean property) {
2989        this.pedantic.setValue(property);
2990    }
2991
2992    /**
2993     * DOCUMENT ME!
2994     *
2995     * @param cacheSize
2996     * The preparedStatementCacheSize to set.
2997     */

2998    public void setPreparedStatementCacheSize(int cacheSize) {
2999        this.preparedStatementCacheSize.setValue(cacheSize);
3000    }
3001
3002    /**
3003     * DOCUMENT ME!
3004     *
3005     * @param cacheSqlLimit
3006     * The preparedStatementCacheSqlLimit to set.
3007     */

3008    public void setPreparedStatementCacheSqlLimit(int cacheSqlLimit) {
3009        this.preparedStatementCacheSqlLimit.setValue(cacheSqlLimit);
3010    }
3011
3012    /**
3013     * DOCUMENT ME!
3014     *
3015     * @param property
3016     */

3017    public void setProfileSql(boolean property) {
3018        this.profileSQL.setValue(property);
3019        this.profileSQLAsBoolean = this.profileSQL.getValueAsBoolean();
3020    }
3021
3022    /**
3023     * DOCUMENT ME!
3024     *
3025     * @param flag
3026     * The profileSQL to set.
3027     */

3028    public void setProfileSQL(boolean flag) {
3029        this.profileSQL.setValue(flag);
3030    }
3031
3032    /**
3033     * @param propertiesTransform
3034     * The propertiesTransform to set.
3035     */

3036    public void setPropertiesTransform(String JavaDoc value) {
3037        this.propertiesTransform.setValue(value);
3038    }
3039
3040    /**
3041     * DOCUMENT ME!
3042     *
3043     * @param property
3044     */

3045    public void setQueriesBeforeRetryMaster(int property) {
3046        this.queriesBeforeRetryMaster.setValue(property);
3047    }
3048
3049    /**
3050     * DOCUMENT ME!
3051     *
3052     * @param property
3053     */

3054    public void setReconnectAtTxEnd(boolean property) {
3055        this.reconnectAtTxEnd.setValue(property);
3056        this.reconnectTxAtEndAsBoolean = this.reconnectAtTxEnd
3057                .getValueAsBoolean();
3058    }
3059
3060    /**
3061     * DOCUMENT ME!
3062     *
3063     * @param property
3064     */

3065    public void setRelaxAutoCommit(boolean property) {
3066        this.relaxAutoCommit.setValue(property);
3067    }
3068
3069    /**
3070     * DOCUMENT ME!
3071     *
3072     * @param millis
3073     * The reportMetricsIntervalMillis to set.
3074     */

3075    public void setReportMetricsIntervalMillis(int millis) {
3076        this.reportMetricsIntervalMillis.setValue(millis);
3077    }
3078
3079    /**
3080     * DOCUMENT ME!
3081     *
3082     * @param property
3083     */

3084    public void setRequireSSL(boolean property) {
3085        this.requireSSL.setValue(property);
3086    }
3087
3088    /**
3089     * @param rollbackOnPooledClose
3090     * The rollbackOnPooledClose to set.
3091     */

3092    public void setRollbackOnPooledClose(boolean flag) {
3093        this.rollbackOnPooledClose.setValue(flag);
3094    }
3095
3096    /**
3097     * Sets whether or not hosts will be picked in a round-robin fashion.
3098     *
3099     * @param flag
3100     * The roundRobinLoadBalance property to set.
3101     */

3102    public void setRoundRobinLoadBalance(boolean flag) {
3103        this.roundRobinLoadBalance.setValue(flag);
3104    }
3105
3106    /**
3107     * @param runningCTS13
3108     * The runningCTS13 to set.
3109     */

3110    public void setRunningCTS13(boolean flag) {
3111        this.runningCTS13.setValue(flag);
3112    }
3113
3114    /**
3115     * DOCUMENT ME!
3116     *
3117     * @param property
3118     */

3119    public void setSecondsBeforeRetryMaster(int property) {
3120        this.secondsBeforeRetryMaster.setValue(property);
3121    }
3122
3123    /**
3124     * DOCUMENT ME!
3125     *
3126     * @param property
3127     * DOCUMENT ME!
3128     */

3129    public void setServerTimezone(String JavaDoc property) {
3130        this.serverTimezone.setValue(property);
3131    }
3132
3133    /**
3134     * @param sessionVariables
3135     * The sessionVariables to set.
3136     */

3137    public void setSessionVariables(String JavaDoc variables) {
3138        this.sessionVariables.setValue(variables);
3139    }
3140
3141    /**
3142     * DOCUMENT ME!
3143     *
3144     * @param millis
3145     * The slowQueryThresholdMillis to set.
3146     */

3147    public void setSlowQueryThresholdMillis(int millis) {
3148        this.slowQueryThresholdMillis.setValue(millis);
3149    }
3150
3151    /**
3152     * DOCUMENT ME!
3153     *
3154     * @param property
3155     */

3156    public void setSocketFactoryClassName(String JavaDoc property) {
3157        this.socketFactoryClassName.setValue(property);
3158    }
3159
3160    /**
3161     * DOCUMENT ME!
3162     *
3163     * @param property
3164     */

3165    public void setSocketTimeout(int property) {
3166        this.socketTimeout.setValue(property);
3167    }
3168
3169    /**
3170     * DOCUMENT ME!
3171     *
3172     * @param property
3173     */

3174    public void setStrictFloatingPoint(boolean property) {
3175        this.strictFloatingPoint.setValue(property);
3176    }
3177
3178    /**
3179     * DOCUMENT ME!
3180     *
3181     * @param property
3182     */

3183    public void setStrictUpdates(boolean property) {
3184        this.strictUpdates.setValue(property);
3185    }
3186
3187    /**
3188     * @param tinyInt1isBit
3189     * The tinyInt1isBit to set.
3190     */

3191    public void setTinyInt1isBit(boolean flag) {
3192        this.tinyInt1isBit.setValue(flag);
3193    }
3194
3195    /**
3196     * DOCUMENT ME!
3197     *
3198     * @param flag
3199     * The logProtocol to set.
3200     */

3201    public void setTraceProtocol(boolean flag) {
3202        this.traceProtocol.setValue(flag);
3203    }
3204
3205    public void setTransformedBitIsBoolean(boolean flag) {
3206        this.transformedBitIsBoolean.setValue(flag);
3207    }
3208
3209    /**
3210     * DOCUMENT ME!
3211     *
3212     * @param property
3213     */

3214    public void setUseCompression(boolean property) {
3215        this.useCompression.setValue(property);
3216    }
3217
3218    /**
3219     * @param useFastIntParsing
3220     * The useFastIntParsing to set.
3221     */

3222    public void setUseFastIntParsing(boolean flag) {
3223        this.useFastIntParsing.setValue(flag);
3224    }
3225
3226    /**
3227     * DOCUMENT ME!
3228     *
3229     * @param property
3230     */

3231    public void setUseHostsInPrivileges(boolean property) {
3232        this.useHostsInPrivileges.setValue(property);
3233    }
3234
3235    /**
3236     * @param useLocalSessionState
3237     * The useLocalSessionState to set.
3238     */

3239    public void setUseLocalSessionState(boolean flag) {
3240        this.useLocalSessionState.setValue(flag);
3241    }
3242
3243    /**
3244     * DOCUMENT ME!
3245     *
3246     * @param property
3247     */

3248    public void setUseNewIo(boolean property) {
3249        this.useNewIo.setValue(property);
3250    }
3251
3252    /**
3253     * @param useOldUTF8Behavior
3254     * The useOldUTF8Behavior to set.
3255     */

3256    public void setUseOldUTF8Behavior(boolean flag) {
3257        this.useOldUTF8Behavior.setValue(flag);
3258        this.useOldUTF8BehaviorAsBoolean = this.useOldUTF8Behavior
3259                .getValueAsBoolean();
3260    }
3261
3262    /**
3263     * @param useOnlyServerErrorMessages
3264     * The useOnlyServerErrorMessages to set.
3265     */

3266    public void setUseOnlyServerErrorMessages(boolean flag) {
3267        this.useOnlyServerErrorMessages.setValue(flag);
3268    }
3269
3270    /**
3271     * @param useReadAheadInput
3272     * The useReadAheadInput to set.
3273     */

3274    public void setUseReadAheadInput(boolean flag) {
3275        this.useReadAheadInput.setValue(flag);
3276    }
3277
3278    /**
3279     * DOCUMENT ME!
3280     *
3281     * @param flag
3282     * The detectServerPreparedStmts to set.
3283     */

3284    public void setUseServerPreparedStmts(boolean flag) {
3285        this.detectServerPreparedStmts.setValue(flag);
3286    }
3287
3288    /**
3289     * DOCUMENT ME!
3290     *
3291     * @param flag
3292     * The useSqlStateCodes to set.
3293     */

3294    public void setUseSqlStateCodes(boolean flag) {
3295        this.useSqlStateCodes.setValue(flag);
3296    }
3297
3298    /**
3299     * DOCUMENT ME!
3300     *
3301     * @param property
3302     */

3303    public void setUseSSL(boolean property) {
3304        this.useSSL.setValue(property);
3305    }
3306
3307    /**
3308     * DOCUMENT ME!
3309     *
3310     * @param property
3311     */

3312    public void setUseStreamLengthsInPrepStmts(boolean property) {
3313        this.useStreamLengthsInPrepStmts.setValue(property);
3314    }
3315
3316    /**
3317     * DOCUMENT ME!
3318     *
3319     * @param property
3320     */

3321    public void setUseTimezone(boolean property) {
3322        this.useTimezone.setValue(property);
3323    }
3324
3325    /**
3326     * DOCUMENT ME!
3327     *
3328     * @param property
3329     */

3330    public void setUseUltraDevWorkAround(boolean property) {
3331        this.useUltraDevWorkAround.setValue(property);
3332    }
3333
3334    /**
3335     * DOCUMENT ME!
3336     *
3337     * @param flag
3338     * The useUnbufferedInput to set.
3339     */

3340    public void setUseUnbufferedInput(boolean flag) {
3341        this.useUnbufferedInput.setValue(flag);
3342    }
3343
3344    /**
3345     * DOCUMENT ME!
3346     *
3347     * @param flag
3348     * The useUnicode to set.
3349     */

3350    public void setUseUnicode(boolean flag) {
3351        this.useUnicode.setValue(flag);
3352        this.useUnicodeAsBoolean = this.useUnicode.getValueAsBoolean();
3353    }
3354
3355    /**
3356     * Sets whether or not the driver advises of proper usage.
3357     *
3358     * @param useUsageAdvisorFlag
3359     * whether or not the driver advises of proper usage.
3360     */

3361    public void setUseUsageAdvisor(boolean useUsageAdvisorFlag) {
3362        this.useUsageAdvisor.setValue(useUsageAdvisorFlag);
3363        this.useUsageAdvisorAsBoolean = this.useUsageAdvisor
3364                .getValueAsBoolean();
3365    }
3366
3367    public void setYearIsDateType(boolean flag) {
3368        this.yearIsDateType.setValue(flag);
3369    }
3370
3371    /**
3372     * @param zeroDateTimeBehavior
3373     * The zeroDateTimeBehavior to set.
3374     */

3375    public void setZeroDateTimeBehavior(String JavaDoc behavior) {
3376        this.zeroDateTimeBehavior.setValue(behavior);
3377    }
3378
3379    protected void storeToRef(Reference JavaDoc ref) throws SQLException JavaDoc {
3380        int numPropertiesToSet = PROPERTY_LIST.size();
3381
3382        for (int i = 0; i < numPropertiesToSet; i++) {
3383            java.lang.reflect.Field JavaDoc propertyField = (java.lang.reflect.Field JavaDoc) PROPERTY_LIST
3384                    .get(i);
3385
3386            try {
3387                ConnectionProperty propToStore = (ConnectionProperty) propertyField
3388                        .get(this);
3389
3390                if (ref != null) {
3391                    propToStore.storeTo(ref);
3392                }
3393            } catch (IllegalAccessException JavaDoc iae) {
3394                throw new SQLException JavaDoc("Huh?");
3395            }
3396        }
3397    }
3398
3399    /**
3400     * DOCUMENT ME!
3401     *
3402     * @return Returns the useUnbufferedInput.
3403     */

3404    protected boolean useUnbufferedInput() {
3405        return this.useUnbufferedInput.getValueAsBoolean();
3406    }
3407}
3408
Popular Tags