| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>15. Oracle</title><link rel="stylesheet" href="css/docbook.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="manual.html" title="Apache OpenJPA 1.2 User's Guide"><link rel="up" href="supported_databases.html" title="Appendix 2. Supported Databases"><link rel="prev" href="dbsupport_mysql.html" title="14. MySQL"><link rel="next" href="dbsupport_pointbase.html" title="16. Pointbase"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">15. |
| Oracle |
| </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dbsupport_mysql.html">Prev</a> </td><th width="60%" align="center">Appendix 2. |
| Supported Databases |
| </th><td width="20%" align="right"> <a accesskey="n" href="dbsupport_pointbase.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="dbsupport_oracle"></a>15. |
| Oracle |
| </h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="dbsupport_oracle.html#dbsupport_oracle_query_hints">15.1. |
| Using Query Hints with Oracle |
| </a></span></dt><dt><span class="section"><a href="dbsupport_oracle.html#dbsupport_oracle_issues">15.2. |
| Known issues with Oracle |
| </a></span></dt></dl></div><div class="example"><a name="example_props_oracle"></a><p class="title"><b>Example 2.15. |
| Example properties for Oracle |
| </b></p><div class="example-contents"><pre class="programlisting"> |
| openjpa.ConnectionDriverName: oracle.jdbc.driver.OracleDriver |
| openjpa.ConnectionURL: jdbc:oracle:thin:@SERVER_NAME:1521:DB_NAME |
| </pre></div></div><br class="example-break"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="dbsupport_oracle_query_hints"></a>15.1. |
| Using Query Hints with Oracle |
| </h3></div></div></div><p> |
| Oracle has support for "query hints", which are formatted comments embedded in |
| SQL that provide some hint for how the query should be executed. These hints are |
| usually designed to provide suggestions to the Oracle query optimizer for how to |
| efficiently perform a certain query, and aren't typically needed for any but |
| the most intensive queries. |
| </p><div class="example"><a name="dbsupport_oracle_query_hints_ex"></a><p class="title"><b>Example 2.16. |
| Using Oracle Hints |
| </b></p><div class="example-contents"><pre class="programlisting"> |
| Query query = em.createQuery(...); |
| query.setHint("openjpa.hint.OracleSelectHint", "/*+ first_rows(100) */"); |
| List results = query.getResultList(); |
| </pre></div></div><br class="example-break"></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="dbsupport_oracle_issues"></a>15.2. |
| Known issues with Oracle |
| </h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p> |
| The Oracle JDBC driver has significant differences between different versions. |
| It is important to use the officially supported version of the driver |
| (10.2.0.1.0), which is backward compatible with previous versions of the Oracle |
| server. It can be downloaded from |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html" target="_top"> |
| http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html</a>. |
| </p></li><li><p> |
| For VARCHAR fields, <code class="literal">null</code> and a blank string are equivalent. |
| This means that an object that stores a null string field will have it get read |
| back as a blank string. |
| </p></li><li><p> |
| Oracle corp's JDBC driver for Oracle has only limited support for batch updates. |
| The result for OpenJPA is that in some cases, the exact object that failed an |
| optimistic lock check cannot be determined, and OpenJPA will throw an |
| <code class="classname">OptimisticVerificationException</code> with more failed objects |
| than actually failed. |
| </p></li><li><p> |
| Oracle cannot store numbers with more than 38 digits in numeric columns. |
| </p></li><li><p> |
| Floats and doubles may lose precision when stored. |
| </p></li><li><p> |
| CLOB columns cannot be used in queries. |
| </p></li></ul></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="dbsupport_mysql.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="supported_databases.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="dbsupport_pointbase.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">14. |
| MySQL |
| </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 16. |
| Pointbase |
| </td></tr></table></div></body></html> |