Oracle TopLink Developer's Guide
10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
Most JDBC drivers support the run-time configuration of various options to customize driver operation to meet user needs. TopLink provides direct support (in API and TopLink Workbench) for many of the most important options, as this section describes, as well as more advanced options (see "Configuring Advanced Options")
You can also configure additional options by specifying properties (see "Configuring Properties").
Note: Not all drivers support all JDBC options. Selecting a combination of options may result in different behavior from one driver to another. Before selecting JDBC options, consult your JDBC driver documentation. |
To specify the JDBC options for a relational server (or database) session login, use this procedure:
Select a relational server (or database) session in the Navigator. Its properties appear in the Editor.
Click the Login tab. The Login tab appears.
Click the Options subtab. The Options subtab appears.
Figure 86-5 Login – Options Tab, JDBC Options
Option | Description |
---|---|
Queries Should Bind All ParametersFoot 1 | Select this option to bind all of the query's parameters |
Cache All StatementsFootref 1 | When selected, TopLink caches each prepared statement so that when reexecuted, you avoid the SQL preparation time which improves performance. |
Byte Array BindingFootref 1 | Select this option if you query binary large object (BLOB) data. |
Streams for BindingFootref 1 | Select this option if you use a JDBC driver that is more efficient at handling BLOB data using java.io.InputStream and java.io.OutputStream .
|
Native SQL | By default, TopLink generates SQL using JDBC SQL grammar. Select this option if you want TopLink to use database specific SQL grammar, for example, if your database driver does not support the full JDBC SQL grammar. |
Batch WritingFoot 2 | Select this option if you use a JDBC driver that supports sending groups of INSERT , UPDATE , and DELETE statements to the database in a single transaction, rather than individually.
Select JDBC to use the batch writing capabilities of your JDBC driver. Select TopLink to use the native batch writing capabilities that TopLink provides. Select this option if your JDBC driver does not support batch writing. |
String BindingFootref 1 | Select this option if you query large java.lang.String objects.
You can configure the maximum |
Footnote 1 For more information, see "Parameterized SQL (Binding) and Prepared Statement Caching".
Footnote 2 If you are using the MySQL4
database platform (see "Data Source Platform Types"), use JDBC batch writing (do not use TopLink batch writing). For more information, see "Batch Writing".
To enable parameterized SQL and prepared statement caching for all queries, configure at the Login
level, as Example 86-10 shows. For more information, see "Parameterized SQL (Binding) and Prepared Statement Caching".
Example 86-10 Parameterized SQL and Binding at the Login Level
databaseLogin.bindAllParameters(); databaseLogin.cacheAllStatements(); databaseLogin.setStatementCacheSize(100);
To enable JDBC batch writing, use Login
method useBatchWriting
as Example 86-11 shows: