KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > sessions > DatabaseLogin


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.sessions;
23
24 import java.io.*;
25 import java.sql.Connection JavaDoc;
26 import oracle.toplink.essentials.internal.databaseaccess.Platform;
27 import oracle.toplink.essentials.internal.databaseaccess.DatabasePlatform;
28 import oracle.toplink.essentials.internal.databaseaccess.Accessor;
29 import oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor;
30 import oracle.toplink.essentials.internal.localization.*;
31 import oracle.toplink.essentials.platform.database.*;
32 import oracle.toplink.essentials.platform.database.oracle.OraclePlatform;
33 import oracle.toplink.essentials.sequencing.NativeSequence;
34 import oracle.toplink.essentials.exceptions.*;
35 import oracle.toplink.essentials.jndi.*;
36
37 /**
38  * <p>
39  * <b>Purpose</b>:
40  * Hold the configuration information necessary to connect to a JDBC driver.
41  * <p>
42  * <b>Description</b>:
43  * A DatabaseLogin is used by a TopLink database session to connect to a
44  * JDBC server.
45  * <p>
46  * <b>Responsibilities</b>:
47  * <ul>
48  * <li> Hold the driver class name and URL header
49  * <li> Hold the database URL
50  * <li> Hold any driver-specific database connection properties (e.g. "user", "database")
51  * <li> Build the JDBC driver connect string
52  * <li> Hold the database platform (e.g. Oracle, DB2)
53  * <li> Hold the message logging stream
54  * <li> Hold other assorted configuration settings
55  * </ul>
56  */

57 public class DatabaseLogin extends DatasourceLogin {
58
59     /**
60      * Transaction isolation levels used in setTransactionIsolation().
61      * These constants are cribbed from java.sql.Connection.
62      */

63     /** Transactions are not supported. */
64     public static final int TRANSACTION_NONE = Connection.TRANSACTION_NONE;
65
66     /** Dirty reads, non-repeatable reads and phantom reads can occur. */
67     public static final int TRANSACTION_READ_UNCOMMITTED = Connection.TRANSACTION_READ_UNCOMMITTED;
68
69     /** Dirty reads are prevented; non-repeatable reads and phantom reads can occur. */
70     public static final int TRANSACTION_READ_COMMITTED = Connection.TRANSACTION_READ_COMMITTED;
71
72     /** Dirty reads and non-repeatable reads are prevented; phantom reads can occur. */
73     public static final int TRANSACTION_REPEATABLE_READ = Connection.TRANSACTION_REPEATABLE_READ;
74
75     /** Dirty reads, non-repeatable reads and phantom reads are prevented. */
76     public static final int TRANSACTION_SERIALIZABLE = Connection.TRANSACTION_SERIALIZABLE;
77
78     /**
79      * PUBLIC:
80      * Create a new login.
81      */

82     public DatabaseLogin() {
83         this(new DatabasePlatform());
84     }
85
86     /**
87      * ADVANCED:
88      * Create a new login for the given platform.
89      */

90     public DatabaseLogin(DatabasePlatform databasePlatform) {
91         super(databasePlatform);
92         this.useDefaultDriverConnect();
93     }
94
95     /**
96      * ADVANCED:
97      * Set the database platform to be custom platform.
98      */

99     public void usePlatform(DatabasePlatform platform) {
100         super.usePlatform((Platform)platform);
101     }
102
103     /**
104      * PUBLIC:
105      * Bind all arguments to any SQL statement.
106      */

107     public void bindAllParameters() {
108         setShouldBindAllParameters(true);
109     }
110
111     /**
112      * INTERNAL:
113      * Build and return an appropriate Accessor.
114      * The default is a DatabaseAccessor.
115      */

116     public Accessor buildAccessor() {
117         return new DatabaseAccessor();
118     }
119
120     /**
121      * PUBLIC:
122      * Cache all prepared statements, this requires full parameter binding as well.
123      * @see #bindAllParameters()
124      */

125     public void cacheAllStatements() {
126         setShouldCacheAllStatements(true);
127     }
128
129     /**
130      * PUBLIC:
131      * Do not bind all arguments to any SQL statement.
132      */

133     public void dontBindAllParameters() {
134         setShouldBindAllParameters(false);
135     }
136
137     /**
138      * PUBLIC:
139      * Do not cache all prepared statements.
140      */

141     public void dontCacheAllStatements() {
142         setShouldCacheAllStatements(false);
143     }
144
145     /**
146      * PUBLIC:
147      * Disable driver level data conversion optimization.
148      * This can be disabled as some drivers perform data conversion themselves incorrectly.
149      */

150     public void dontOptimizeDataConversion() {
151         setShouldOptimizeDataConversion(false);
152     }
153
154     /**
155      * PUBLIC:
156      * TopLink can be configured to use parameter binding for large binary data.
157      * By default TopLink will print this data as hex through the JDBC binary excape clause.
158      * Both binding and printing have various limits on all databases (e.g. 5k - 32k).
159      */

160     public void dontUseByteArrayBinding() {
161         setUsesByteArrayBinding(false);
162     }
163
164     /**
165      * PUBLIC:
166      * TopLink can be configured to use database-specific SQL grammar,
167      * as opposed to the JDBC standard grammar.
168      * This is because, unfortunately, some drivers to not support the full JDBC standard.
169      * By default TopLink uses the JDBC SQL grammar.
170      */

171     public void dontUseNativeSQL() {
172         setUsesNativeSQL(false);
173     }
174
175     /**
176      * PUBLIC:
177      * TopLink can be configured to use streams to store large binary data.
178      */

179     public void dontUseStreamsForBinding() {
180         setUsesStreamsForBinding(false);
181     }
182
183     /**
184      * PUBLIC:
185      * Do not bind strings of any size.
186      */

187     public void dontUseStringBinding() {
188         getPlatform().setStringBindingSize(0);
189         getPlatform().setUsesStringBinding(false);
190     }
191
192     /**
193      * INTERNAL:
194      * Return whether the specified driver is being used.
195      */

196     protected boolean driverIs(String JavaDoc driverName) {
197         try {
198             return getDriverClassName().equals(driverName);
199         } catch (ValidationException e) {
200             // this exception will be thrown if we are using something other than a DefaultConnector
201
return false;
202         }
203     }
204
205     /**
206      * PUBLIC:
207      * Return the JDBC connection string.
208      * This is a combination of the driver-specific URL header and the database URL.
209      */

210     public String JavaDoc getConnectionString() throws ValidationException {
211         return getDefaultConnector().getConnectionString();
212     }
213
214     /**
215      * ADVANCED:
216      * Return the code for preparing cursored output
217      * parameters in a stored procedure
218      */

219     public int getCursorCode() {
220         return getPlatform().getCursorCode();
221     }
222
223     /**
224      * PUBLIC:
225      * The database name is required when connecting to databases that support
226      * multiple databases within a single server instance (e.g. Sybase, SQL Server).
227      * This is ONLY used when connecting through ODBC type JDBC drivers.
228      * This is NEVER used with Oracle.
229      */

230     public String JavaDoc getDatabaseName() {
231         return properties.getProperty("database");
232     }
233
234     /**
235      * PUBLIC:
236      * The database URL is the JDBC URL for the database server.
237      * The driver header is <i>not</i> be included in this URL
238      * (e.g. "dbase files"; not "jdbc:odbc:dbase files").
239      */

240     public String JavaDoc getDatabaseURL() throws ValidationException {
241         return getDefaultConnector().getDatabaseURL();
242     }
243
244     /**
245      * PUBLIC:
246      * The data source name is required if connecting through ODBC (JDBC-ODBC, etc.).
247      * This is the ODBC name given in the ODBC Data Source Administrator.
248      * This is just the database part of the URL.
249      */

250     public String JavaDoc getDataSourceName() throws ValidationException {
251         return getDatabaseURL();
252     }
253
254     /**
255      * INTERNAL:
256      * Return the connector that will instantiate the java.sql.Connection.
257      */

258     protected DefaultConnector getDefaultConnector() throws ValidationException {
259         try {
260             return (DefaultConnector)getConnector();
261         } catch (ClassCastException JavaDoc e) {
262             throw ValidationException.invalidConnector(connector);
263         }
264     }
265
266     /**
267      * PUBLIC:
268      * The driver class is the name of the Java class for the JDBC driver being used
269      * (e.g. "sun.jdbc.odbc.JdbcOdbcDriver").
270      */

271     public String JavaDoc getDriverClassName() throws ValidationException {
272         return getDefaultConnector().getDriverClassName();
273     }
274
275     /**
276      * PUBLIC:
277      * The driver URL header is the string predetermined by the JDBC driver to be
278      * part of the URL connection string, (e.g. "jdbc:odbc:").
279      * This is required to connect to the database.
280      */

281     public String JavaDoc getDriverURLHeader() throws ValidationException {
282         return getDefaultConnector().getDriverURLHeader();
283     }
284
285     /**
286      * PUBLIC:
287      * The server name is the name of the database instance.
288      * This is ONLY required if using an ODBC JDBC driver
289      * and overriding the server name specified in the ODBC
290      * Data Source Administrator.
291      */

292     public String JavaDoc getServerName() {
293         return properties.getProperty("server");
294     }
295
296     /**
297      * PUBLIC:
298      * Used to help bean introspection.
299      */

300     public boolean getShouldBindAllParameters() {
301         return shouldBindAllParameters();
302     }
303
304     /**
305      * PUBLIC:
306      * Used to help bean introspection.
307      */

308     public boolean getShouldCacheAllStatements() {
309         return shouldCacheAllStatements();
310     }
311
312     /**
313      * PUBLIC:
314      * Used to help bean introspection.
315      */

316     public boolean getShouldOptimizeDataConversion() {
317         return shouldOptimizeDataConversion();
318     }
319
320     /**
321      * PUBLIC:
322      * Used to help bean introspection.
323      */

324     public boolean getShouldTrimStrings() {
325         return shouldTrimStrings();
326     }
327
328     /**
329      * PUBLIC:
330      * If prepared statement caching is used, return the cache size.
331      * The default is 50.
332      */

333     public int getStatementCacheSize() {
334         return getPlatform().getStatementCacheSize();
335     }
336
337     /**
338      * PUBLIC:
339      * Used to help bean introspection.
340      */

341     public int getStringBindingSize() {
342         return getPlatform().getStringBindingSize();
343     }
344
345     /**
346      * PUBLIC:
347      * Return the transaction isolation setting for the connection.
348      * Return -1 if it has not been set.
349      */

350     public int getTransactionIsolation() {
351         return getPlatform().getTransactionIsolation();
352     }
353
354     /**
355      * PUBLIC:
356      * Used to help bean introspection.
357      */

358     public boolean getUsesBinding() {
359         return shouldUseByteArrayBinding();
360     }
361
362     /**
363      * PUBLIC:
364      * Used to help bean introspection.
365      */

366     public boolean getUsesNativeSequencing() {
367         return shouldUseNativeSequencing();
368     }
369
370     /**
371      * PUBLIC:
372      * Used to help bean introspection.
373      */

374     public boolean getUsesNativeSQL() {
375         return shouldUseNativeSQL();
376     }
377
378     /**
379      * PUBLIC:
380      * Used to help bean introspection.
381      */

382     public boolean getUsesStreamsForBinding() {
383         return shouldUseStreamsForBinding();
384     }
385
386     /**
387      * PUBLIC:
388      * Used to help bean introspection.
389      */

390     public boolean getUsesStringBinding() {
391         return getPlatform().usesStringBinding();
392     }
393
394     /**
395      * PUBLIC:
396      * Force TopLink to manually begin transactions instead of using autoCommit.
397      * Although autoCommit should be used, and work, under JDBC,
398      * some drivers (e.g. Sybase JConnect)
399      * do not correctly map autoCommit to transactions, so stored procedures
400      * may not work correctly.
401      * This property should only be used as a workaround for the
402      * Sybase JConnect transaction problem.
403      */

404     public void handleTransactionsManuallyForSybaseJConnect() {
405         getPlatform().setSupportsAutoCommit(false);
406     }
407
408     /**
409      * PUBLIC:
410      * Return whether an Oracle JDBC driver is being used.
411      */

412     public boolean isAnyOracleJDBCDriver() {
413         return oracleDriverIs("jdbc:oracle:");
414     }
415
416     /**
417      * PUBLIC:
418      * Return whether a Cloudscape JDBC driver is being used.
419      */

420     public boolean isCloudscapeJDBCDriver() {
421         return driverIs("COM.cloudscape.core.JDBCDriver");
422     }
423
424     /**
425      * PUBLIC:
426      * Return whether an IBM DB2 native client JDBC driver is being used.
427      */

428     public boolean isDB2JDBCDriver() {
429         return driverIs("COM.ibm.db2.jdbc.app.DB2Driver");
430     }
431
432     /**
433      * PUBLIC:
434      * Return whether an Intersolv SeqeLink JDBC driver is being used.
435      */

436     public boolean isIntersolvSequeLinkDriver() {
437         return driverIs("intersolv.jdbc.sequelink.SequeLinkDriver");
438     }
439
440     /**
441      * PUBLIC:
442      * Return whether a Sybase JConnect JDBC driver is being used.
443      */

444     public boolean isJConnectDriver() {
445         return driverIs("com.sybase.jdbc.SybDriver");
446     }
447
448     /**
449      * PUBLIC:
450      * Return whether a Borland JDBCConnect JDBC driver is being used.
451      */

452     public boolean isJDBCConnectDriver() {
453         return driverIs("borland.jdbc.Bridge.LocalDriver");
454     }
455
456     /**
457      * PUBLIC:
458      * Return whether a Borland JDBCConnect JDBC driver is being used.
459      */

460     public boolean isJDBCConnectRemoteDriver() {
461         return driverIs("borland.jdbc.Broker.RemoteDriver");
462     }
463
464     /**
465      * PUBLIC:
466      * Return whether a Sun/Merant JDBC-ODBC bridge driver is being used.
467      */

468     public boolean isJDBCODBCBridge() {
469         return driverIs("sun.jdbc.odbc.JdbcOdbcDriver");
470     }
471
472     /**
473      * PUBLIC:
474      * Return whether an Oracle native 7.x OCI JDBC driver is being used.
475      */

476     public boolean isOracle7JDBCDriver() {
477         return oracleDriverIs("jdbc:oracle:oci7:@");
478     }
479
480     /**
481      * PUBLIC:
482      * Return whether an Oracle 8.x native OCI JDBC driver is being used.
483      */

484     public boolean isOracleJDBCDriver() {
485         return oracleDriverIs("jdbc:oracle:oci8:@");
486     }
487
488     /**
489      * PUBLIC:
490      * Return whether an Oracle thin JDBC driver is being used.
491      */

492     public boolean isOracleServerJDBCDriver() {
493         return oracleDriverIs("jdbc:oracle:kprb:");
494     }
495
496     /**
497      * PUBLIC:
498      * Return whether an Oracle thin JDBC driver is being used.
499      */

500     public boolean isOracleThinJDBCDriver() {
501         return oracleDriverIs("jdbc:oracle:thin:@");
502     }
503
504     /**
505      * PUBLIC:
506      * Return whether a WebLogic Oracle OCI JDBC driver is being used.
507      */

508     public boolean isWebLogicOracleOCIDriver() {
509         return driverIs("weblogic.jdbc.oci.Driver");
510     }
511
512     /**
513      * PUBLIC:
514      * Return whether a WebLogic SQL Server dblib JDBC driver is being used.
515      */

516     public boolean isWebLogicSQLServerDBLibDriver() {
517         return driverIs("weblogic.jdbc.dblib.Driver");
518     }
519
520     /**
521      * PUBLIC:
522      * Return whether a WebLogic SQL Server JDBC driver is being used.
523      */

524     public boolean isWebLogicSQLServerDriver() {
525         return driverIs("weblogic.jdbc.mssqlserver4.Driver");
526     }
527
528     /**
529      * PUBLIC:
530      * Return whether a WebLogic Sybase dblib JDBC driver is being used.
531      */

532     public boolean isWebLogicSybaseDBLibDriver() {
533         return driverIs("weblogic.jdbc.dblib.Driver");
534     }
535
536     /**
537      * PUBLIC:
538      * Return whether a WebLogic thin client JDBC driver is being used.
539      */

540     public boolean isWebLogicThinClientDriver() {
541         return driverIs("weblogic.jdbc.t3Client.Driver");
542     }
543
544     /**
545      * PUBLIC:
546      * Return whether a WebLogic thin JDBC driver is being used.
547      */

548     public boolean isWebLogicThinDriver() {
549         return driverIs("weblogic.jdbc.t3.Driver");
550     }
551
552     /**
553      * PUBLIC:
554      * Enable driver level data conversion optimization.
555      * This can be disabled as some drivers perform data conversion themselves incorrectly.
556      */

557     public void optimizeDataConversion() {
558         setShouldOptimizeDataConversion(true);
559     }
560
561     /**
562      * INTERNAL:
563      * Return whether the specified Oracle JDBC driver is being used.
564      */

565     protected boolean oracleDriverIs(String JavaDoc urlPrefix) {
566         try {
567             if (getDriverURLHeader().length() != 0) {
568                 return getDriverURLHeader().indexOf(urlPrefix) != -1;
569             } else {
570                 return getDatabaseURL().indexOf(urlPrefix) != -1;
571             }
572         } catch (ValidationException e) {
573             // this exception will be thrown if we are using something other than a DefaultConnector
574
return false;
575         }
576     }
577
578     /**
579      * PUBLIC:
580      * Set the JDBC connection string.
581      * This is the full JDBC connect URL. Normally TopLink breaks this into two parts to
582      * allow for the driver header to be automatically set, however sometimes it is easier just to set the
583      * entire URL at once.
584      */

585     public void setConnectionString(String JavaDoc url) throws ValidationException {
586         setDriverURLHeader("");
587         setDatabaseURL(url);
588     }
589
590     /**
591      * ADVANCED:
592      * Set the code for preparing cursored output
593      * parameters in a stored procedure
594      */

595     public void setCursorCode(int cursorCode) {
596         getPlatform().setCursorCode(cursorCode);
597     }
598
599     /**
600      * PUBLIC:
601      * The database name is required when connecting to databases that support
602      * multiple databases within a single server instance (e.g. Sybase, SQL Server).
603      * This is ONLY used when connecting through ODBC type JDBC drivers.
604      * This is NEVER used with Oracle.
605      */

606     public void setDatabaseName(String JavaDoc databaseName) {
607         setProperty("database", databaseName);
608     }
609
610     /**
611      * PUBLIC:
612      * The database URL is the JDBC URL for the database server.
613      * The driver header should <i>not</i> be included in this URL
614      * (e.g. "dbase files"; not "jdbc:odbc:dbase files").
615      */

616     public void setDatabaseURL(String JavaDoc databaseURL) throws ValidationException {
617         getDefaultConnector().setDatabaseURL(databaseURL);
618     }
619     
620     /**
621      * PUBLIC:
622      * The data source name is required if connecting through ODBC (JDBC-ODBC, etc.).
623      * This is the ODBC name given in the ODBC Data Source Administrator.
624      * This is just the database part of the URL.
625      */

626     public void setODBCDataSourceName(String JavaDoc dataSourceName) {
627         setDatabaseURL(dataSourceName);
628     }
629
630     /**
631      * PUBLIC:
632      * The default value to substitute for database NULLs can be configured
633      * on a per-class basis.
634      * Example: login.setDefaultNullValue(long.class, new Long(0))
635      */

636     public void setDefaultNullValue(Class JavaDoc type, Object JavaDoc value) {
637         getPlatform().getConversionManager().setDefaultNullValue(type, value);
638     }
639
640     /**
641      * PUBLIC:
642      * The driver class is the Java class for the JDBC driver to be used
643      * (e.g. sun.jdbc.odbc.JdbcOdbcDriver.class).
644      */

645     public void setDriverClass(Class JavaDoc driverClass) {
646         setDriverClassName(driverClass.getName());
647     }
648
649     /**
650      * PUBLIC:
651      * The name of the JDBC driver class to be used
652      * (e.g. "sun.jdbc.odbc.JdbcOdbcDriver").
653      */

654     public void setDriverClassName(String JavaDoc driverClassName) throws ValidationException {
655         getDefaultConnector().setDriverClassName(driverClassName);
656     }
657
658     /**
659      * PUBLIC:
660      * The driver URL header is the string predetermined by the JDBC driver to be
661      * part of the URL connection string, (e.g. "jdbc:odbc:").
662      * This is required to connect to the database.
663      */

664     public void setDriverURLHeader(String JavaDoc driverURLHeader) throws ValidationException {
665         getDefaultConnector().setDriverURLHeader(driverURLHeader);
666     }
667
668     /**
669      * PUBLIC:
670      * The server name is the name of the database instance.
671      * This is ONLY used when connecting through ODBC type JDBC drivers,
672      * and only if the data source does not specify it already.
673      */

674     public void setServerName(String JavaDoc name) {
675         setProperty("server", name);
676     }
677
678     /**
679      * PUBLIC:
680      * Set whether to bind all arguments to any SQL statement.
681      */

682     public void setShouldBindAllParameters(boolean shouldBindAllParameters) {
683         getPlatform().setShouldBindAllParameters(shouldBindAllParameters);
684     }
685
686     /**
687      * PUBLIC:
688      * Set whether prepared statements should be cached.
689      */

690     public void setShouldCacheAllStatements(boolean shouldCacheAllStatements) {
691         getPlatform().setShouldCacheAllStatements(shouldCacheAllStatements);
692     }
693
694     /**
695      * ADVANCED:
696      * This setting can be used if the application expects upper case
697      * but the database does not return consistent case (e.g. different databases).
698      */

699     public void setShouldForceFieldNamesToUpperCase(boolean shouldForceFieldNamesToUpperCase) {
700         getPlatform().setShouldForceFieldNamesToUpperCase(shouldForceFieldNamesToUpperCase);
701     }
702
703     /**
704      * ADVANCED:
705      * Allow for case in field names to be ignored as some databases are not case sensitive.
706      * When using custom this can be an issue if the fields in the descriptor have a different case.
707      */

708     public static void setShouldIgnoreCaseOnFieldComparisons(boolean shouldIgnoreCaseOnFieldComparisons) {
709         DatabasePlatform.setShouldIgnoreCaseOnFieldComparisons(shouldIgnoreCaseOnFieldComparisons);
710     }
711
712     /**
713      * PUBLIC:
714      * Set whether driver level data conversion optimization is enabled.
715      * This can be disabled as some drivers perform data conversion themselves incorrectly.
716      */

717     public void setShouldOptimizeDataConversion(boolean value) {
718         getPlatform().setShouldOptimizeDataConversion(value);
719     }
720
721     /**
722      * PUBLIC:
723      * By default CHAR field values have trailing blanks trimmed, this can be configured.
724      */

725     public void setShouldTrimStrings(boolean shouldTrimStrings) {
726         getPlatform().setShouldTrimStrings(shouldTrimStrings);
727     }
728
729     /**
730      * PUBLIC:
731      * If prepared statement caching is used this configures the cache size.
732      * The default is 50.
733      */

734     public void setStatementCacheSize(int size) {
735         getPlatform().setStatementCacheSize(size);
736     }
737
738     /**
739      * PUBLIC:
740      * Used to help bean introspection.
741      */

742     public void setStringBindingSize(int stringBindingSize) {
743         getPlatform().setStringBindingSize(stringBindingSize);
744     }
745
746     /**
747      * PUBLIC:
748      * Set the default qualifier for all tables.
749      * This can be the creator of the table or database name the table exists on.
750      * This is required by some databases such as Oracle and DB2.
751      */

752     public void setTableQualifier(String JavaDoc qualifier) {
753         getPlatform().setTableQualifier(qualifier);
754     }
755
756     /**
757      * PUBLIC:
758      * Set the transaction isolation setting for the connection.
759      * This is an optional setting. The default isolation level
760      * set on the database will apply if it is not set here.
761      * Use one of the TRANSACTION_* constants for valid input values.
762      * Note: This setting will only take effect upon connection.
763      */

764     public void setTransactionIsolation(int isolationLevel) {
765         getPlatform().setTransactionIsolation(isolationLevel);
766     }
767
768     /**
769      * PUBLIC:
770      * TopLink can be configured to use parameter binding for large binary data.
771      * By default TopLink will print this data as hex through the JDBC binary excape clause.
772      * Both binding and printing have various limits on all databases (e.g. 5k - 32k).
773      */

774     public void setUsesByteArrayBinding(boolean value) {
775         getPlatform().setUsesByteArrayBinding(value);
776     }
777
778     /**
779      * PUBLIC:
780      * TopLink can be configured to use database specific sql grammar not JDBC specific.
781      * This is because unfortunately some bridges to not support the full JDBC standard.
782      * By default TopLink uses the JDBC sql grammar.
783      */

784     public void setUsesNativeSQL(boolean value) {
785         getPlatform().setUsesNativeSQL(value);
786     }
787
788     /**
789      * PUBLIC:
790      * TopLink can be configured to use streams to store large binary data.
791      * This can improve the max size for reading/writing on some JDBC drivers.
792      */

793     public void setUsesStreamsForBinding(boolean value) {
794         getPlatform().setUsesStreamsForBinding(value);
795     }
796
797     /**
798      * PUBLIC:
799      * Used to help bean introspection.
800      */

801     public void setUsesStringBinding(boolean usesStringBindingSize) {
802         getPlatform().setUsesStringBinding(usesStringBindingSize);
803     }
804
805     /**
806      * PUBLIC:
807      * Bind all arguments to any SQL statement.
808      */

809     public boolean shouldBindAllParameters() {
810         return getPlatform().shouldBindAllParameters();
811     }
812
813     /**
814      * PUBLIC:
815      * Cache all prepared statements, this requires full parameter binding as well.
816      */

817     public boolean shouldCacheAllStatements() {
818         return getPlatform().shouldCacheAllStatements();
819     }
820
821     /**
822      * ADVANCED:
823      * Can be used if the app expects upper case but the database is not return consistent case, i.e. different databases.
824      */

825     public boolean shouldForceFieldNamesToUpperCase() {
826         return getPlatform().shouldForceFieldNamesToUpperCase();
827     }
828
829     /**
830      * ADVANCED:
831      * Allow for case in field names to be ignored as some databases are not case sensitive.
832      * When using custom this can be an issue if the fields in the descriptor have a different case.
833      */

834     public static boolean shouldIgnoreCaseOnFieldComparisons() {
835         return DatabasePlatform.shouldIgnoreCaseOnFieldComparisons();
836     }
837
838     /**
839      * PUBLIC:
840      * Return if our driver level data conversion optimization is enabled.
841      * This can be disabled as some drivers perform data conversion themselves incorrectly.
842      */

843     public boolean shouldOptimizeDataConversion() {
844         return getPlatform().shouldOptimizeDataConversion();
845     }
846
847     /**
848      * PUBLIC:
849      * By default CHAR field values have trailing blanks trimmed, this can be configured.
850      */

851     public boolean shouldTrimStrings() {
852         return getPlatform().shouldTrimStrings();
853     }
854
855     /**
856      * PUBLIC:
857      * TopLink can be configured to use parameter binding for large binary data.
858      * By default TopLink will print this data as hex through the JDBC binary excape clause.
859      * Both binding and printing have various limits on all databases (e.g. 5k - 32k).
860      */

861     public boolean shouldUseByteArrayBinding() {
862         return getPlatform().usesByteArrayBinding();
863     }
864
865     /**
866      * PUBLIC:
867      * TopLink can be configured to use a sequence table
868      * or native sequencing to generate unique object IDs.
869      * Native sequencing uses the ID generation service provided by the database
870      * (e.g. SEQUENCE objects on Oracle and IDENTITY columns on Sybase).
871      * By default a sequence table is used. Using a sequence table is recommended
872      * as it supports preallocation.
873      * (Native sequencing on Sybase/SQL Server/Informix does not support preallocation.
874      * Preallocation can be supported on Oracle by setting the increment size of the
875      * SEQUENCE object to match the preallocation size.)
876      */

877     public boolean shouldUseNativeSequencing() {
878         return getPlatform().getDefaultSequence() instanceof NativeSequence;
879     }
880
881     /**
882      * PUBLIC:
883      * TopLink can be configured to use database-specific SQL grammar,
884      * as opposed to the JDBC standard grammar.
885      * This is because, unfortunately, some drivers to not support the full JDBC standard.
886      * By default TopLink uses the JDBC SQL grammar.
887      */

888     public boolean shouldUseNativeSQL() {
889         return getPlatform().usesNativeSQL();
890     }
891
892     /**
893      * PUBLIC:
894      * TopLink can be configured to use streams to store large binary data.
895      */

896     public boolean shouldUseStreamsForBinding() {
897         return getPlatform().usesStreamsForBinding();
898     }
899
900     /**
901      * PUBLIC:
902      * TopLink can be configured to bind large strings.
903      */

904     public boolean shouldUseStringBinding() {
905         return getPlatform().usesStringBinding();
906     }
907
908     /**
909      * PUBLIC:
910      * Print all of the connection information.
911      */

912     public String JavaDoc toString() {
913         StringWriter stringWriter = new StringWriter();
914         PrintWriter writer = new PrintWriter(stringWriter);
915         writer.println("DatabaseLogin(");
916         writer.println("\t" + ToStringLocalization.buildMessage("platform", (Object JavaDoc[])null) + "=>" + getPlatform());
917         writer.println("\t" + ToStringLocalization.buildMessage("user_name", (Object JavaDoc[])null) + "=> \"" + getUserName() + "\"");
918         writer.print("\t");
919         getConnector().toString(writer);
920         if (getServerName() != null) {
921             writer.println("\t" + ToStringLocalization.buildMessage("server_name", (Object JavaDoc[])null) + "=> \"" + getServerName() + "\"");
922         }
923         if (getDatabaseName() != null) {
924             writer.println("\t" + ToStringLocalization.buildMessage("database_name", (Object JavaDoc[])null) + "=> \"" + getDatabaseName() + "\"");
925         }
926         writer.write(")");
927         return stringWriter.toString();
928     }
929
930     /**
931      * PUBLIC:
932      * Set the database platform to be Access.
933      */

934     public void useAccess() {
935         if (getPlatform().isAccess()) {
936             return;
937         }
938
939         DatabasePlatform newPlatform = new AccessPlatform();
940         getPlatform().copyInto(newPlatform);
941         setPlatform(newPlatform);
942     }
943
944     /**
945      * PUBLIC:
946      * TopLink can be configured to use parameter binding for large binary data.
947      * By default TopLink will print this data as hex through the JDBC binary excape clause.
948      * Both binding and printing have various limits on all databases (e.g. 5k - 32k).
949      */

950     public void useByteArrayBinding() {
951         setUsesByteArrayBinding(true);
952     }
953
954     /**
955      * PUBLIC:
956      * Set the database platform to be Cloudscape.
957      */

958     public void useCloudscape() {
959         if (getPlatform().isCloudscape()) {
960             return;
961         }
962
963         DatabasePlatform newPlatform = new CloudscapePlatform();
964         getPlatform().copyInto(newPlatform);
965         setPlatform(newPlatform);
966     }
967
968     public void useDerby() {
969         if (getPlatform().isDerby()) {
970             return;
971         }
972
973         DatabasePlatform newPlatform = new DerbyPlatform();
974         getPlatform().copyInto(newPlatform);
975         setPlatform(newPlatform);
976     }
977
978
979     /**
980      * PUBLIC:
981      * Use the Cloudscape JDBC driver.
982      */

983     public void useCloudscapeDriver() {
984         useCloudscape();
985         setDriverClassName("COM.cloudscape.core.JDBCDriver");
986         setDriverURLHeader("jdbc:cloudscape:");
987     }
988
989     /**
990      * PUBLIC:
991      * Set the database platform to be DB2.
992      */

993     public void useDB2() {
994         if (getPlatform().isDB2()) {
995             return;
996         }
997
998         DatabasePlatform newPlatform = new DB2Platform();
999         getPlatform().copyInto(newPlatform);
1000        setPlatform(newPlatform);
1001    }
1002
1003    /**
1004     * PUBLIC:
1005     * Use the IBM DB2 native client interface.
1006     */

1007    public void useDB2JDBCDriver() {
1008        useDB2();
1009        setDriverClassName("COM.ibm.db2.jdbc.app.DB2Driver");
1010        setDriverURLHeader("jdbc:db2:");
1011        useStreamsForBinding();// Works best with IBM driver
1012
}
1013
1014    /**
1015     * PUBLIC:
1016     * Use the IBM DB2 thin JDBC driver.
1017     */

1018    public void useDB2NetJDBCDriver() {
1019        useDB2();
1020        setDriverClassName("COM.ibm.db2.jdbc.net.DB2Driver");
1021        setDriverURLHeader("jdbc:db2:");
1022        useStreamsForBinding();// Works best with IBM driver
1023
}
1024
1025    /**
1026     * PUBLIC:
1027     * Set the database platform to be DBase.
1028     */

1029    public void useDBase() {
1030        if (getPlatform().isDBase()) {
1031            return;
1032        }
1033
1034        DatabasePlatform newPlatform = new DBasePlatform();
1035        getPlatform().copyInto(newPlatform);
1036        setPlatform(newPlatform);
1037    }
1038
1039    /**
1040     * PUBLIC:
1041     * Connect to the JDBC driver via DriverManager.
1042     * @see #useDirectDriverConnect()
1043     */

1044    public void useDefaultDriverConnect() {
1045        setConnector(new DefaultConnector());
1046    }
1047
1048    /**
1049     * PUBLIC:
1050     * Connect to the JDBC driver via DriverManager.
1051     * @see #useDirectDriverConnect(String, String, String)
1052     */

1053    public void useDefaultDriverConnect(String JavaDoc driverClassName, String JavaDoc driverURLHeader, String JavaDoc databaseURL) {
1054        setConnector(new DefaultConnector(driverClassName, driverURLHeader, databaseURL));
1055    }
1056
1057    /**
1058     * PUBLIC:
1059     * Some JDBC drivers don't support connecting correctly (via DriverManager),
1060     * but do support connecting incorrectly (e.g. Castanet).
1061     * @see #useDirectDriverConnect()
1062     */

1063    public void useDirectDriverConnect() {
1064        setConnector(new DirectConnector());
1065    }
1066    
1067    /**
1068     * PUBLIC:
1069     * Specify the J2EE DataSource name to connect to.
1070     * Also enable external connection pooling.
1071     * @see JNDIConnector
1072     */

1073    public void useDataSource(String JavaDoc dataSource) {
1074        setConnector(new JNDIConnector(dataSource));
1075        useExternalConnectionPooling();
1076    }
1077    
1078    /**
1079     * PUBLIC:
1080     * Specify the J2EE JTA enabled DataSource name to connect to.
1081     * Also enable external transaction control and connection pooling.
1082     * @see JNDIConnector
1083     */

1084    public void useJTADataSource(String JavaDoc dataSource) {
1085        useDataSource(dataSource);
1086        useExternalTransactionController();
1087    }
1088
1089    /**
1090     * PUBLIC:
1091     * Some JDBC drivers don't support connecting correctly (via DriverManager),
1092     * but do support connecting incorrectly (e.g. Castanet).
1093     * @see #useDefaultDriverConnect(String, String, String)
1094     */

1095    public void useDirectDriverConnect(String JavaDoc driverClassName, String JavaDoc driverURLHeader, String JavaDoc databaseURL) {
1096        setConnector(new DirectConnector(driverClassName, driverURLHeader, databaseURL));
1097    }
1098
1099    /**
1100     * PUBLIC:
1101     * Use external connection pooling, such as WebLogic's JTS driver.
1102     *
1103     * @see #dontUseExternalConnectionPooling()
1104     * @see #shouldUseExternalConnectionPooling()
1105     */

1106    public void useExternalConnectionPooling() {
1107        setUsesExternalConnectionPooling(true);
1108    }
1109
1110    /**
1111     * PUBLIC:
1112     * Use an external transaction controller such as a JTS service
1113     *
1114     * @see #dontUseExternalTransactionController()
1115     * @see #shouldUseExternalTransactionController()
1116     */

1117    public void useExternalTransactionController() {
1118        setUsesExternalTransactionController(true);
1119    }
1120
1121    /**
1122     * PUBLIC:
1123     * Use the HSQL JDBC driver.
1124     */

1125    public void useHSQL() {
1126        if (getPlatform().isHSQL()) {
1127            return;
1128        }
1129
1130        DatabasePlatform newPlatform = new HSQLPlatform();
1131        getPlatform().copyInto(newPlatform);
1132        setPlatform(newPlatform);
1133    }
1134
1135    /**
1136     * PUBLIC:
1137     * Use the HSQL JDBC driver.
1138     */

1139    public void useHSQLDriver() {
1140        useHSQL();
1141        setDriverClassName("org.hsqldb.jdbcDriver");
1142        setDriverURLHeader("jdbc:hsqldb:");
1143    }
1144
1145    /**
1146     * PUBLIC:
1147     * Use the i-net SQL Server JDBC driver.
1148     */

1149    public void useINetSQLServerDriver() {
1150        setDriverClassName("com.inet.tds.TdsDriver");
1151        setDriverURLHeader("jdbc:inetdae:");
1152    }
1153
1154    /**
1155     * PUBLIC:
1156     * Set the database platform to be Informix.
1157     */

1158    public void useInformix() {
1159        if (getPlatform().isInformix()) {
1160            return;
1161        }
1162
1163        DatabasePlatform newPlatform = new InformixPlatform();
1164        getPlatform().copyInto(newPlatform);
1165        setPlatform(newPlatform);
1166    }
1167
1168    /**
1169     * PUBLIC:
1170     * Use the Intersolv/Merant SequeLink JDBC driver.
1171     */

1172    public void useIntersolvSequeLinkDriver() {
1173        setDriverClassName("intersolv.jdbc.sequelink.SequeLinkDriver");
1174        setDriverURLHeader("jdbc:sequelink:");
1175    }
1176
1177    /**
1178     * PUBLIC:
1179     * Use the Sybase JConnect JDBC driver.
1180     */

1181    public void useJConnect50Driver() {
1182        useSybase();
1183        setDriverClassName("com.sybase.jdbc2.jdbc.SybDriver");
1184        setDriverURLHeader("jdbc:sybase:Tds:");
1185        // JConnect does not support the JDBC SQL grammar
1186
useNativeSQL();
1187    }
1188
1189    /**
1190     * PUBLIC:
1191     * Use the Sybase JConnect JDBC driver.
1192     */

1193    public void useJConnectDriver() {
1194        useSybase();
1195        setDriverClassName("com.sybase.jdbc.SybDriver");
1196        setDriverURLHeader("jdbc:sybase:Tds:");
1197        // JConnect does not support the JDBC SQL grammar
1198
useNativeSQL();
1199    }
1200
1201    /**
1202     * PUBLIC:
1203     * Set the database platform to be JDBC.
1204     */

1205    public void useJDBC() {
1206        DatabasePlatform newPlatform = new DatabasePlatform();
1207        getPlatform().copyInto(newPlatform);
1208        setPlatform(newPlatform);
1209    }
1210
1211    /**
1212     * PUBLIC:
1213     * Use the Borland JDBCConnect JDBC driver.
1214     */

1215    public void useJDBCConnectDriver() {
1216        setDriverClassName("borland.jdbc.Bridge.LocalDriver");
1217        setDriverURLHeader("jdbc:BorlandBridge:");
1218    }
1219
1220    /**
1221     * PUBLIC:
1222     * Use the Borland JDBCConnect JDBC driver.
1223     */

1224    public void useJDBCConnectRemoteDriver() {
1225        setDriverClassName("borland.jdbc.Broker.RemoteDriver");
1226        setDriverURLHeader("jdbc:BorlandBridge:");
1227    }
1228
1229    /**
1230     * PUBLIC:
1231     * User the Sun/Merant JDBC-ODBC bridge driver.
1232     */

1233    public void useJDBCODBCBridge() {
1234        setDriverClassName("sun.jdbc.odbc.JdbcOdbcDriver");
1235        setDriverURLHeader("jdbc:odbc:");
1236    }
1237
1238    /**
1239     * PUBLIC:
1240     * Set the database platform to be MySQL.
1241     */

1242    public void useMySQL() {
1243        if (getPlatform().isMySQL()) {
1244            return;
1245        }
1246
1247        DatabasePlatform newPlatform = new MySQL4Platform();
1248        getPlatform().copyInto(newPlatform);
1249        setPlatform(newPlatform);
1250    }
1251
1252    /**
1253     * PUBLIC:
1254     * TopLink can be configured to use a sequence table
1255     * or native sequencing to generate unique object IDs.
1256     * Native sequencing uses the ID generation service provided by the database
1257     * (e.g. SEQUENCE objects on Oracle and IDENTITY columns on Sybase).
1258     * By default a sequence table is used. Using a sequence table is recommended
1259     * as it supports preallocation.
1260     * (Native sequencing on Sybase/SQL Server/Informix does not support preallocation.
1261     * Preallocation can be supported on Oracle by setting the increment size of the
1262     * SEQUENCE object to match the preallocation size.)
1263     */

1264    public void useNativeSequencing() {
1265        if(!shouldUseNativeSequencing()) {
1266            getPlatform().setDefaultSequence(new NativeSequence(getPlatform().getDefaultSequence().getName(),
1267                    getPlatform().getDefaultSequence().getPreallocationSize(),
1268                    getPlatform().getDefaultSequence().getInitialValue()));
1269        }
1270    }
1271
1272    /**
1273     * PUBLIC:
1274     * TopLink can be configured to use database-specific SQL grammar,
1275     * as opposed to the JDBC standard grammar.
1276     * This is because, unfortunately, some drivers to not support the full JDBC standard.
1277     * By default TopLink uses the JDBC SQL grammar.
1278     */

1279    public void useNativeSQL() {
1280        setUsesNativeSQL(true);
1281    }
1282
1283    /**
1284     * PUBLIC:
1285     * Set the database platform to be Oracle.
1286     */

1287    public void useOracle() {
1288        if (getPlatform().isOracle()) {
1289            return;
1290        }
1291
1292        DatabasePlatform newPlatform = new OraclePlatform();
1293        getPlatform().copyInto(newPlatform);
1294        setPlatform(newPlatform);
1295    }
1296
1297    /**
1298     * PUBLIC:
1299     * Use the Oracle 7.x native OCI JDBC driver.
1300     */

1301    public void useOracle7JDBCDriver() {
1302        useOracle();
1303        setDriverClassName("oracle.jdbc.OracleDriver");
1304        setDriverURLHeader("jdbc:oracle:oci7:@");
1305        // Oracle works best with stream binding.
1306
useByteArrayBinding();
1307        useStreamsForBinding();
1308    }
1309
1310    /**
1311     * PUBLIC:
1312     * Use the Oracle 8.x native OCI JDBC driver.
1313     */

1314    public void useOracleJDBCDriver() {
1315        useOracle();
1316        setDriverClassName("oracle.jdbc.OracleDriver");
1317        setDriverURLHeader("jdbc:oracle:oci8:@");
1318        // Oracle works best with stream binding.
1319
useByteArrayBinding();
1320        useStreamsForBinding();
1321    }
1322
1323    /**
1324     * PUBLIC:
1325     * Use the Oracle server JDBC driver.
1326     */

1327    public void useOracleServerJDBCDriver() {
1328        useOracle();
1329        setDriverClassName("oracle.jdbc.OracleDriver");
1330        setDriverURLHeader("jdbc:oracle:kprb:");
1331        // Oracle works best with stream binding.
1332
useByteArrayBinding();
1333    }
1334
1335    /**
1336     * PUBLIC:
1337     * Use the Oracle thin JDBC driver.
1338     */

1339    public void useOracleThinJDBCDriver() {
1340        useOracle();
1341        setDriverClassName("oracle.jdbc.OracleDriver");
1342        setDriverURLHeader("jdbc:oracle:thin:@");
1343        // Oracle works best with stream binding.
1344
useByteArrayBinding();
1345        useStreamsForBinding();
1346    }
1347
1348    /**
1349     * PUBLIC:
1350     * Set the database platform to be PointBase.
1351     */

1352    public void usePointBase() {
1353        if (getPlatform().isPointBase()) {
1354            return;
1355        }
1356
1357        DatabasePlatform newPlatform = new PointBasePlatform();
1358        getPlatform().copyInto(newPlatform);
1359        setPlatform(newPlatform);
1360    }
1361
1362    /**
1363     * PUBLIC:
1364     * Use the PointBase JDBC driver.
1365     */

1366    public void usePointBaseDriver() {
1367        usePointBase();
1368        setDriverClassName("com.pointbase.jdbc.jdbcUniversalDriver");
1369        setDriverURLHeader("jdbc:pointbase:");
1370    }
1371
1372    /**
1373     * PUBLIC:
1374     * Set the database platform to be SQL Server.
1375     */

1376    public void useSQLServer() {
1377        if (getPlatform().isSQLServer()) {
1378            return;
1379        }
1380
1381        DatabasePlatform newPlatform = new SQLServerPlatform();
1382        getPlatform().copyInto(newPlatform);
1383        setPlatform(newPlatform);
1384    }
1385
1386    /**
1387     * PUBLIC:
1388     * TopLink can be configured to use streams to store large binary data.
1389     */

1390    public void useStreamsForBinding() {
1391        setUsesStreamsForBinding(true);
1392    }
1393
1394    /**
1395     * PUBLIC:
1396     * Bind strings larger than 255 characters.
1397     */

1398    public void useStringBinding() {
1399        this.useStringBinding(255);
1400    }
1401
1402    /**
1403     * PUBLIC:
1404     * Bind strings that are larger than the specified size.
1405     * Strings that are smaller will not be bound.
1406     */

1407    public void useStringBinding(int size) {
1408        getPlatform().setStringBindingSize(size);
1409        getPlatform().setUsesStringBinding(true);
1410    }
1411
1412    /**
1413     * PUBLIC:
1414     * Set the database platform to be Sybase.
1415     */

1416    public void useSybase() {
1417        if (getPlatform().isSybase()) {
1418            return;
1419        }
1420
1421        DatabasePlatform newPlatform = new SybasePlatform();
1422        getPlatform().copyInto(newPlatform);
1423        setPlatform(newPlatform);
1424    }
1425
1426    /**
1427     * PUBLIC:
1428     * Set the prepare cursor code to what the WebLogic
1429     * Oracle OCI JDBC driver expects.
1430     */

1431    public void useWebLogicDriverCursoredOutputCode() {
1432        setCursorCode(1111);
1433    }
1434
1435    /**
1436     * PUBLIC:
1437     * Set a WebLogic JDBC connection pool (a pool must be defined for the entity beans that are to be deployed)
1438     */

1439    public void useWebLogicJDBCConnectionPool(String JavaDoc poolName) {
1440        setDriverClassName("weblogic.jdbc.jts.Driver");
1441        setConnectionString("jdbc:weblogic:jts:" + poolName);
1442    }
1443
1444    /**
1445     * PUBLIC:
1446     * Use the WebLogic Oracle OCI JDBC driver.
1447     */

1448    public void useWebLogicOracleOCIDriver() {
1449        useOracle();
1450        setDriverClassName("weblogic.jdbc.oci.Driver");
1451        setDriverURLHeader("jdbc:weblogic:oracle:");
1452        // WebLogic has a bug converting dates to strings, which our optimizations require.
1453
dontOptimizeDataConversion();
1454        useWebLogicDriverCursoredOutputCode();
1455    }
1456
1457    /**
1458     * PUBLIC:
1459     * Use the WebLogic SQL Server dblib JDBC driver.
1460     */

1461    public void useWebLogicSQLServerDBLibDriver() {
1462        useSQLServer();
1463        setDriverClassName("weblogic.jdbc.dblib.Driver");
1464        setDriverURLHeader("jdbc:weblogic:mssqlserver:");
1465        // WebLogic has a bug converting dates to strings, which our optimizations require.
1466
dontOptimizeDataConversion();
1467    }
1468
1469    /**
1470     * PUBLIC:
1471     * Use the WebLogic SQL Server JDBC driver.
1472     */

1473    public void useWebLogicSQLServerDriver() {
1474        useSQLServer();
1475        setDriverClassName("weblogic.jdbc.mssqlserver4.Driver");
1476        setDriverURLHeader("jdbc:weblogic:mssqlserver4:");
1477        // WebLogic has a bug converting dates to strings, which our optimizations require.
1478
dontOptimizeDataConversion();
1479    }
1480
1481    /**
1482     * PUBLIC:
1483     * Use the WebLogic Sybase dblib JDBC driver.
1484     */

1485    public void useWebLogicSybaseDBLibDriver() {
1486        useSybase();
1487        setDriverClassName("weblogic.jdbc.dblib.Driver");
1488        setDriverURLHeader("jdbc:weblogic:sybase:");
1489        // WebLogic has a bug converting dates to strings, which our optimizations require.
1490
dontOptimizeDataConversion();
1491    }
1492
1493    /**
1494     * PUBLIC:
1495     * Use the WebLogic thin client JDBC driver.
1496     */

1497    public void useWebLogicThinClientDriver() {
1498        setDriverClassName("weblogic.jdbc.t3Client.Driver");
1499        setDriverURLHeader("jdbc:weblogic:t3Client:");
1500    }
1501
1502    /**
1503     * PUBLIC:
1504     * Use the WebLogic thin JDBC driver.
1505     */

1506    public void useWebLogicThinDriver() {
1507        setDriverClassName("weblogic.jdbc.t3.Driver");
1508        setDriverURLHeader("jdbc:weblogic:t3:");
1509    }
1510}
1511
Popular Tags