tag:blogger.com,1999:blog-251556712024-03-19T03:01:36.770-07:00360 Degree DB Programming & AnalyticsOracle Database Integration with Java, JavaScript, Hadoop, Spark
I - Java in the database, JDBC, UCP, DRCP, Application Continuity, Transaction Guard
II - Oracle Datasource for Hadoop (OD4H), In-Database Container for
Hadoop, Orale Datasource for Spark
III - JavaScript Stored Procedures using Nashorn
All topics discussed here represent my own opinions and speculations.Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.comBlogger108125tag:blogger.com,1999:blog-25155671.post-16068294034749028352019-10-01T16:20:00.001-07:002019-10-01T16:20:22.837-07:00Java Development with Autonomous Transaction Processing Dedicated (ATP-D)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; color: rgba(0, 0, 0, 0.84); font-family: medium-content-serif-font, Georgia, Cambria, "Times New Roman", Times, serif; font-size: 21px; letter-spacing: -0.084px;">The Oracle Autonomous Transaction Processing Dedicated (</span><a class="bl fb nb nc nd ne" href="https://blogs.oracle.com/oracle-database/autonomous-database-dedicated-exadata-cloud-infrastructure" rel="noopener" style="-webkit-tap-highlight-color: transparent; background-color: white; background-image: url("data:image/svg+xml; background-position: 0px calc(1em + 1px); background-repeat: repeat-x; background-size: 1px 1px; box-sizing: inherit; font-family: medium-content-serif-font, Georgia, Cambria, "Times New Roman", Times, serif; font-size: 21px; http: //www.w3.org/2000/svg\"><line x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\" stroke=\"rgba(0, 0, 0, 0.84)\" /></svg>"); letter-spacing: -0.084px; text-decoration-line: none;" target="_blank">ATP-D</a><span style="background-color: white; color: rgba(0, 0, 0, 0.84); font-family: medium-content-serif-font, Georgia, Cambria, "Times New Roman", Times, serif; font-size: 21px; letter-spacing: -0.084px;">) is a database Cloud service which allows implementing a private database Cloud service running on dedicated Exadata Infrastructure within the Oracle Public Cloud. The goal of this blog article is to help you, Java developer or architect, build and deploy fast, scalable, and reliable Java applications with ATP-D, using plain Java, Java Servlets, or Java Microservices with WebLogic, Helidon, WebSphere, Liberty, Tomcat, WildFly (JBoss), Spring, and so on.</span><br />
<br />
<br />
<img src="https://miro.medium.com/max/1020/1*TBglpDQfDykCj6VJqKhMeg.png" /><br />
Please read the full blog post @ <a href="https://medium.com/oracledevs/java-development-with-autonomous-transaction-processing-dedicated-atp-d-f0355a2f9abd">https://medium.com/oracledevs/java-development-with-autonomous-transaction-processing-dedicated-atp-d-f0355a2f9abd</a></div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com63tag:blogger.com,1999:blog-25155671.post-16879631663208460712019-10-01T16:04:00.005-07:002019-10-01T16:18:59.042-07:00Oracle JDBC drivers on Maven Central<div dir="ltr" style="text-align: left;" trbidi="on">
<img src="https://miro.medium.com/max/718/1*43vy4Oh7dJDP6jleXTR_kA.png" /><br />
<br />
<h1 class="nt nu dd ao an cw nv nw nx ny nz oa ob oc od oe of" data-selectable-paragraph="" id="7545" style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.84); font-family: medium-content-sans-serif-font, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Arial, sans-serif; font-size: 34px; letter-spacing: -0.022em; line-height: 1.12; margin: 1.95em 0px -0.28em;">
At last!</h1>
<div class="nf ng dd ao nh b ni og nk oh nm oi no oj nq ok ns" data-selectable-paragraph="" id="4611" style="background-color: white; box-sizing: inherit; color: rgba(0, 0, 0, 0.84); font-family: medium-content-serif-font, Georgia, Cambria, "Times New Roman", Times, serif; font-size: 21px; letter-spacing: -0.004em; line-height: 1.58; margin-bottom: -0.46em; margin-top: 0.86em;">
Yes, you asked for it, and with some delay (better late than ..), we did it!<br />
Maven Central becomes a distribution center for the Oracle JDBC drivers. We started with the latest release 19.3.0.0 but will soon add previous and supported releases.<br />
Read the full post @ <a href="https://medium.com/oracledevs/oracle-jdbc-drivers-on-maven-central-64fcf724d8b" style="background-color: transparent;">https://medium.com/oracledevs/oracle-jdbc-drivers-on-maven-central-64fcf724d8b</a></div>
</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com24tag:blogger.com,1999:blog-25155671.post-56052848477711132712019-08-09T16:14:00.001-07:002019-09-09T18:45:19.894-07:00OracleCode One 2019 - My Sessions Pick <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://www.oracle.com/code-one/">OracleCode One 2019</a> is few weeks ahead and like many, you have not yet made up your mind on which sessions to attend or why attend?</span><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Here is a selection of sessions that I highly recommend (full disclosure, I am involved in these sessions).</span><br />
<br />
<br />
<br />
<ul style="text-align: left;">
<li><a href="https://events.rainfocus.com/widget/oracle/oow19/catalogcodeone19?search=DEV4615" style="font-family: "Open Sans", Helvetica, Arial, sans-serif;">Performance and Scalability for Java Applications with an RDBMS: What’s New </a><br /><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Monday, Sep 16, 4:00pm - 4:45pm</span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://events.rainfocus.com/widget/oracle/oow19/catalogcodeone19?search=DEV4616">Zero Downtime for Java Applications: What's New, Use Cases, and Solutions</a></span><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Monday, September 16, 06:00 PM - 06:45 PM<br /></span></li>
<li><a href="https://events.rainfocus.com/widget/oracle/oow19/catalogcodeone19?search=DEV4614" style="color: #3e82e0; font-family: "Open Sans", Helvetica, Arial, sans-serif;">Reactive Streams Processing with a New Java Library, Helidon, and Microservices</a><span style="color: #3e82e0;"><span style="font-family: "open sans" , "helvetica" , "arial" , sans-serif;"> </span></span><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Tuesday, September 17, 05:00 PM - 05:45 PM<br /></span></li>
<li><a href="https://events.rainfocus.com/widget/oracle/oow19/catalogcodeone19?search=DEV6323" style="background-color: white; font-family: Arial, Helvetica, sans-serif;">Java/JDBC Scalability and Asynchrony: Reactive Extension and Fibers</a><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background-color: white;"> </span></span><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Wednesday, September 18, 12:30 PM - 01:15 PM<br /></span></li>
<li><a href="https://events.rainfocus.com/widget/oracle/oow19/catalogcodeone19?search=DEV4612" style="font-family: "Open Sans", Helvetica, Arial, sans-serif;">Developing and Deploying Oracle Database Applications in Kubernetes</a><br /><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Wednesday, September 18, 05:00 PM - 05:45 PM<br /></span></li>
<li><span style="background-color: white;"><a href="https://events.rainfocus.com/widget/oracle/oow19/catalogow19?search=DEV%204612" style="color: #3e82e0; font-family: "Open Sans", Helvetica, Arial, sans-serif;">Developing and Deploying Oracle Database Applications in Kubernetes</a><br /><span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">Wednesday, September 18, 05:00 PM - 05:45 PM<br /></span></span></li>
<li><a href="https://events.rainfocus.com/widget/oracle/oow19/catalogcodeone19?search=DEV1730" style="color: #3e82e0; font-family: "Open Sans", Helvetica, Arial, sans-serif;">Microservices Essentials: Kubernetes & Ecosystem, Data, and Transaction Patterns </a><br /><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Thursday, Sep 19, 9:00am - 9:45am<br /></span></li>
<li><a href="https://events.rainfocus.com/widget/oracle/oow19/catalogcodeone19?search=Dev4692" style="color: #3e82e0; font-family: "Open Sans", Helvetica, Arial, sans-serif;">A Database Proxy for Transparent HA, Performance, Routing, and Security </a><br /><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Thursday, September 19, 12:15 PM - 01:00 PM<br /></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><a href="https://events.rainfocus.com/widget/oracle/oow19/catalogow19?search=CON6685">Exploring the Multicloud: Working with Azure and Oracle Autonomous Database </a></span><br /><span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">Thursday September 19, 1:15 PM - 2:00 PM</span></li>
</ul>
<br />
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">And you don't want to miss this exciting hands-on lab</span></div>
<ul style="text-align: left;">
<li><span style="background-color: white; color: #3e82e0; font-family: "open sans" , "helvetica" , "arial" , sans-serif;"><a href="https://events.rainfocus.com/widget/oracle/oow19/catalogow19?search=HOL4650">Building Microservices Using Oracle Autonomous Database</a></span></li>
<li style="-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; background-repeat: no-repeat; box-sizing: border-box; display: flex; list-style: none; margin: 0px 0px 8px; overflow: hidden; padding: 0px; transition: all 0.2s ease 0s;"><div style="-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; background-repeat: no-repeat; box-sizing: border-box; flex-grow: 1; left: auto; line-height: 33px; list-style: none; overflow: hidden; padding: 0px; position: relative; text-overflow: ellipsis; transition: all 0.2s ease 0s; white-space: nowrap;">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: x-small;">Monday, September 16, 01:00 PM - 02:00 PM<br />Thursday, September 19, 01:30 PM - 02:30 PM (<span style="color: red;">Repeat</span>)</span></div>
</li>
</ul>
<span style="font-family: "arial" , "helvetica" , sans-serif;">See you there.</span></div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com35tag:blogger.com,1999:blog-25155671.post-86434367144756132232018-07-19T12:28:00.002-07:002018-07-19T12:28:29.938-07:00Slides from SV JUG Jul-18th Meetup<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://www.meetup.com/sv-jug/events/252388038/?_xtd=gatlbWFpbF9jbGlja9oAJDIwNDU5YTcxLWRkNDktNDQwZC1iMjM0LWNhMmU0ZDllMjdmMw&_af=event&_af_eid=252388038">SV JUGers</a>, it was a great Meetup.<br />
The slides are <a href="http://www.oracle.com/technetwork/database/application-development/jdbc/sv-jug-adba-5022946.pdf">here</a>.<br />
<br />
Enjoy!</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com97tag:blogger.com,1999:blog-25155671.post-74135449425331046722018-03-29T10:40:00.001-07:002018-07-12T16:08:32.437-07:00Optimizing the Performance & Scalability of Java Applications that use an RDBMS <div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
Preamble</h3>
There is an abundant literature on Java performance (books, articles, blogs, websites, and so on); a Google search returns more than 5 millions hits. To name a few, the <i>Effective Java programming language guide</i>, <i>Java Performance the definitive guide</i>, <i>Java performance tuning newsletter</i> and associated <i>http://www.javaperformancetuning.com </i>website. This is not the purpose of this post.<br />
<br />
The goal of this post is to revisit the known best practices for speeding up and scaling database operations for Java applications then discuss database proxy and the upcoming standard Java API for asynchronous database access (ADBA).<br />
<br />
Even those familiar with Java optimization techniques will learn new tips!<br />
<h3 style="text-align: left;">
Speeding up Java applications that use an RDBMS</h3>
<div>
<br /></div>
<div>
Optimizing database operations for Java applications includes: speeding up database connectivity, speeding up SQL statements processing, optimizing network traffic, and in-place processing. </div>
<h4 style="line-height: 90%; margin-bottom: 0pt; margin-left: 0.25in; margin-top: 12pt; text-align: left; text-indent: -0.25in; unicode-bidi: embed; word-break: normal;">
Speeding up Database Connectivity</h4>
<div style="line-height: 90%; margin-bottom: 0pt; margin-left: 0.25in; margin-top: 12pt; text-align: left; text-indent: -0.25in; unicode-bidi: embed; word-break: normal;">
Connection establishment is the most expensive database operation; the obvious optimization that<br />
<span style="text-indent: -0.25in;">Java</span><span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">developers have been using for ages </span><span style="text-indent: -0.25in;">is connection pooling which avoid creating connections at runtime.</span><span style="text-indent: -0.25in;"> </span><br />
<span style="text-indent: -0.25in;"><i style="text-indent: -0.25in;"><br /></i></span>
<span style="text-indent: -0.25in;"><i style="text-indent: -0.25in;"><br /></i></span><br />
<span style="text-indent: -0.25in;"><i style="text-indent: -0.25in;">Client-side Connection Pools</i></span><br />
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><br /></span></span></span>
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;">Java connection pools such as the Apache Commons DBCP, C3P0, as well as the </span><a href="https://docs.oracle.com/database/122/JJUCP/toc.htm" style="text-indent: -0.25in;">Oracle </a></span></span><br />
<span style="text-indent: -0.25in;"><a href="https://docs.oracle.com/database/122/JJUCP/toc.htm">Universal Connection Pool (UCP) </a>and many others, run as part of your stand-alone Java/JDBC</span><br />
<span style="text-indent: -0.25in;">applications</span><span style="text-indent: -0.25in;"> along the JDBC </span><span style="text-indent: -0.25in;">libraries</span><span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">or as part of Java EE containers datasources </span><span style="text-indent: -0.25in;">(e.g.,</span><br />
<span style="text-indent: -0.25in;">Tomcat, </span><span style="text-indent: -0.25in;">Weblogic, WebSphere </span><span style="text-indent: -0.25in;">and others). Java</span><span style="text-indent: -0.25in;"> EE containers usually furnish their own</span><br />
<span style="text-indent: -0.25in;">connection</span><span style="text-indent: -0.25in;"> pools but </span><span style="text-indent: -0.25in;">they also allow</span><span style="text-indent: -0.25in;"> replacing theirs </span><span style="text-indent: -0.25in;">with 3rd party pools (</span><span style="text-indent: -0.25in;">see using</span><br />
<span style="text-indent: -0.25in;"><a href="http://www.oracle.com/technetwork/database/application-development/planned-unplanned-rlb-ucp-tomcat-2265175.pdf">UCP with Tomcat</a>, <a href="https://blogs.oracle.com/dev2dev/create-and-deploy-a-java-servlet-using-weblogic-server-wls">UCP with</a> </span><span style="text-indent: -0.25in;"><a href="https://blogs.oracle.com/dev2dev/create-and-deploy-a-java-servlet-using-weblogic-server-wls">Weblogic</a>). </span><br />
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><br /></span></span></span>
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;">M</span><span style="text-indent: -0.25in;">ost Java developers use</span><span style="text-indent: -0.25in;"> these </span><span style="text-indent: -0.25in;">client-side or mid-tier connection pools for sustaining </span><span style="text-indent: -0.25in;">small and</span></span></span><br />
<span style="text-indent: -0.25in;"> medium</span><span style="text-indent: -0.25in;"> workloads however, these connection pools are confined to the</span><span style="text-indent: -0.25in;"> JRE/JDK instance</span><br />
<span style="text-indent: -0.25in;">(i.e., </span><span style="text-indent: -0.25in;">can't be shared beyond the boundary of the JRE/JDK) and unpractical when deploying</span><br />
<span style="text-indent: -0.25in;">thens of thousands of mid-tiers or Web servers. Even with very small pool size each, the RDBMS</span><br />
<span style="text-indent: -0.25in;"> server </span><span style="text-indent: -0.25in;"> is overwhelmed by thens of thousands of pre-allocated connections that are</span><span style="text-indent: -0.25in;"> idle</span><span style="text-indent: -0.25in;"> (more</span><br />
<span style="text-indent: -0.25in;">than</span><span style="text-indent: -0.25in;"> 90% of the time).</span><br />
<span style="text-indent: -0.25in;"><i><br /></i></span>
<span style="text-indent: -0.25in;"><i><br /></i></span><br />
<span style="text-indent: -0.25in;"><i>Proxy Connection Pools</i></span><br />
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><br /></span></span></span>
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;">Proxy connection pools such as <a href="https://dev.mysql.com/doc/mysql-router/8.0/en/">MySQL Router</a>, Oracle Database Connection </span><span style="text-indent: -0.25in;">Manager </span><span style="text-indent: -0.25in;">in Traffi</span><span style="text-indent: -0.25in;">c</span></span></span><br />
<span style="text-indent: -0.25in;"> Director Mode (<a href="http://www.oracle.com/technetwork/database/enterprise-edition/cman-overview-084817.html">CMAN-TDM</a>), and others, are part of</span><span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">proxy </span><span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;">servers that sit</span> between the </span><span style="text-indent: -0.25in;">database</span><br />
<span style="text-indent: -0.25in;"> clients</span><span style="text-indent: -0.25in;"> (i.e., Java apps) and the RDBMS. </span><span style="text-indent: -0.25in;">These </span><span style="text-indent: -0.25in;">allow thousands of database clients to share a </span><br />
<span style="text-indent: -0.25in;">common connection</span><span style="text-indent: -0.25in;"> pool. </span><span style="text-indent: -0.25in;">I will discuss this a bit more,</span><span style="text-indent: -0.25in;"> near the end</span><span style="text-indent: -0.25in;"> of this post.</span><br />
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><br /></span></span></span>
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;">The Oracle database also furnishes database-side connection pools such as the </span><a href="https://gerardnico.com/db/oracle/shared_server" style="text-indent: -0.25in;">Shared Servers</a><span style="text-indent: -0.25in;">, and</span></span></span><span style="text-indent: -0.25in;"> the </span><a href="https://docs.oracle.com/cd/E85694_01/ODPNT/featConnecting.htm#ODPNT-GUID-757A465B-4025-4550-8F13-EA92FE0C1B5A" style="text-indent: -0.25in;">Database Resident Connection Pool</a><span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">(DRCP). We will not discuss those in this post.</span><br />
<br />
Other connection optimization features include: deferring connection health <span style="text-indent: -0.25in;">check and the </span><br />
<span style="text-indent: -0.25in;">de-prioritization of failed </span><span style="text-indent: -0.25in;">nodes.</span></div>
<div style="line-height: 90%; margin-bottom: 0pt; margin-left: 0.25in; margin-top: 12pt; text-align: left; text-indent: -0.25in; unicode-bidi: embed; word-break: normal;">
<i> Deferring Connection Health Check</i><br />
<br />
The ability of a connection pool such as Oracle's Universal Connection Pool (UCP) to avoid<br />
checking the health of connections <a href="https://docs.oracle.com/en/database/oracle/oracle-database/12.2/jjucp/validating-ucp-connections.html#GUID-139508B9-1456-41CA-A860-2AFD9352C1E6">for a defined period of time</a>, improves the latency of<br />
connection check-out (i.e., <span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">getConnection()</span> returns faster).<br />
<span style="text-indent: -0.25in;"><i><br /></i></span>
<span style="text-indent: -0.25in;"><i>De-prioritization of Failed Nodes</i></span></div>
<div style="line-height: 90%; margin-bottom: 0pt; margin-left: 0.25in; margin-top: 12pt; text-align: left; text-indent: -0.25in; unicode-bidi: embed; word-break: normal;">
<div style="text-align: left;">
In a multi-instances clustered database environment such as Oracle RAC, <a href="https://docs.oracle.com/en/database/oracle/oracle-database/12.2/jjdbc/JDBC-getting-started.html#GUID-D5BB4E1F-59FD-4C5E-876C-71420F2DAE9B">this JDBC feature </a>assigns<br />
a low <span style="text-indent: -0.25in;">priority to a failed instance for a user-defined period of time thereby reducing the connection</span></div>
<div style="text-align: left;">
establishment latency (iow, avoid attempting to get connections from the failed instance).</div>
<h4 style="text-align: left;">
<span style="text-indent: -0.25in;"><br /></span></h4>
<h4 style="text-align: left;">
<span style="text-indent: -0.25in;">Optimizing Statements Processing</span></h4>
</div>
<div style="line-height: 90%; margin-bottom: 0pt; margin-left: 0.25in; margin-top: 12pt; text-align: left; text-indent: -0.25in; unicode-bidi: embed; word-break: normal;">
<span style="text-indent: -0.25in;">The default COMMIT mode with JDBC is Auto-COMMIT; unless this corresponds to your desire, </span><br />
<span style="text-indent: -0.25in;">you should explicitly disable </span><span style="text-indent: -0.25in;">Auto-COMMIT on the connection object.</span><span style="text-indent: -0.25in;"></span><br />
<span style="text-indent: -0.25in;"><br /><span style="font-family: "courier new" , "courier" , monospace;">conn.setAutoCommit(false);</span></span><br />
<div>
<span style="text-indent: -0.25in;"><br /></span></div>
<span style="text-indent: -0.25in;">Processing a SQL statement requires several steps including</span><span style="text-indent: -0.25in;">: parsing, binding </span><span style="text-indent: -0.25in;">variables, executing,</span><br />
<span style="text-indent: -0.25in;">fetching resultSets (if a query), and</span><span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">COMMITting or </span><span style="text-indent: -0.25in;">ROLLBACKing the transaction (</span><span style="text-indent: -0.25in;">if</span><span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">a DML</span><br />
<span style="text-indent: -0.25in;">i.e., Insert, Update, or </span><span style="text-indent: -0.25in;">Delete).</span><span style="text-indent: -0.25in;"> </span><br />
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><br /></span></span>
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><br /></span></span><br />
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;">Java developers have several options for optimizing SQL statements processing including: </span></span><br />
<span style="text-indent: -0.25in;">Prepared Statements, Statements Caching, ResultSets caching with change notification.</span><br />
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"><br /></span></span></span>
<br />
<i>Prepared Statements</i><br />
<br />
Parsing (i.e., <a href="https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2588723819082">hard parsing</a>) is the most expensive operation during the processing of a SQL statement.<br />
<span style="text-indent: -0.25in;">The best practice consists in avoiding </span><span style="text-indent: -0.25in;">parsing by using Prepared Statements </span><span style="text-indent: -0.25in;">which are parsed only</span><span style="text-indent: -0.25in;"> once then reused many times on subsequent </span><span style="text-indent: -0.25in;">invocations, after</span><span style="text-indent: -0.25in;"> binding variables.</span><span style="text-indent: -0.25in;"> A security</span><br />
<span style="text-indent: -0.25in;"> byproduct of </span><span style="text-indent: -0.25in;">Prepared </span><span style="text-indent: -0.25in;">Statements is to prevent SQL injection.</span><br />
<span style="text-indent: -0.25in;"><br /></span>
<span style="text-indent: -0.25in;">https://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html</span></div>
<div style="line-height: 90%; margin-bottom: 0pt; margin-left: 0.25in; margin-top: 12pt; text-align: left; text-indent: -0.25in; unicode-bidi: embed; word-break: normal;">
<i>Statements Caching</i><br />
<br />
Statement caching significantly improves performance. <span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">T</span><span style="text-indent: -0.25in;">he JDBC </span><span style="text-indent: -0.25in;">driver</span><span style="text-indent: -0.25in;"> caches the SQL statements </span><br />
<span style="text-indent: -0.25in;">(<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">PreparedStatements</span> and <span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">CallableStatements</span>)</span><span style="text-indent: -0.25in;"> on </span><span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace;">close</span>, using an LRU algorithm then refers</span><br />
<span style="text-indent: -0.25in;">the </span><span style="text-indent: -0.25in;">RDBMS</span><span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">to</span><span style="text-indent: -0.25in;"> the </span><span style="text-indent: -0.25in;">parsed form in its </span><span style="text-indent: -0.25in;">library </span><span style="text-indent: -0.25in;">cache </span><span style="text-indent: -0.25in;">(i.e., "</span><i style="text-indent: -0.25in;">use statement </i><i style="text-indent: -0.25in;">#2</i><span style="text-indent: -0.25in;">)</span><span style="text-indent: -0.25in;">, </span><span style="text-indent: -0.25in;">during </span><span style="text-indent: -0.25in;">subsequent</span><br />
<span style="text-indent: -0.25in;">invocations of the </span><span style="text-indent: -0.25in;">same statement</span><span style="text-indent: -0.25in;">. Enabled by setting </span><span style="text-indent: -0.25in;"> Implicit statement caching to true and</span><br />
allocating a statement <span style="text-indent: -0.25in;">cache in the driver memory </span><span style="text-indent: -0.25in;">(i.e., an array per physical connection).</span><br />
<span style="text-indent: -0.25in;">
</span><br />
<div class="page" title="Page 116">
<div class="layoutArea">
<div class="column">
<span style="font-family: "courier"; font-size: 10pt; text-indent: -0.25in;"> </span><br />
<span style="font-family: "courier"; font-size: 10.000000pt;">OracleDataSource ods = new OracleDataSource(); </span><br />
<span style="font-family: "courier"; font-size: 10.000000pt;">... </span><br />
<span style="font-family: "courier"; font-size: 10.000000pt;">ods.setImplicitCachingEnabled( true ); </span><br />
<span style="font-family: "courier"; font-size: 10.000000pt;"></span><br />
<span style="font-family: "courier"; font-size: 13.3333px;">ods.setStmtCacheSize(nn);</span><br />
<div>
<span style="font-family: "courier"; font-size: 13.3333px;"><br /></span></div>
<span style="font-family: "courier"; font-size: 10.000000pt;">...</span><br />
<br /></div>
</div>
</div>
<i>ResultSets Caching with Change Notification - the Hard Way (JDBC-OCI)</i><br />
<br />
Caching JDBC result sets avoids re-executing the corresponding SQL query, resulting in dramatic<br />
Java applications performance. RDBMSes allow caching ResultSet at the server <span style="text-indent: -0.25in;">side but the </span><br />
<span style="text-indent: -0.25in;">applications needs a roundtrip to the database to get these. Optimizing further, these result set can be</span><br />
<span style="text-indent: -0.25in;">pushed to the drivers (Java, C/C++, PHP, C#, and so on) and grabbed by the applications without</span><br />
<span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">database roundtrips. </span><br />
<span style="text-indent: -0.25in;">Then what if </span><span style="text-indent: -0.25in;">the ResultSets become stale, out of sync with the actual RDBMS data? RDBMSes </span><br />
<span style="text-indent: -0.25in;">furnish mechanisms to maintain the ResultSets, up to date. For example, the Oracle database's </span><span style="text-indent: -0.25in;">Query</span><br />
<span style="text-indent: -0.25in;">Change Notifications allows registering a SQL query with the RDBMS and receiving notifications</span><br />
<span style="text-indent: -0.25in;">when committed </span><span style="text-indent: -0.25in;">DMLs from </span><span style="text-indent: -0.25in;">other threads render the ResultSets out of sync. </span><br />
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;">Java applications may explicitly implement ResultSet caching with change notification through the</span></span><br />
<span style="text-indent: -0.25in;"><span style="text-indent: -0.25in;"> </span></span><span style="text-indent: -0.25in;">following </span><span style="text-indent: -0.25in;">steps:</span><br />
<div style="text-align: left;">
<br /></div>
<span style="text-indent: -0.25in;">Prerequisite: grant CHANGE NOTIFICATION to the schema (i.e., database user); </span><br />
<span style="text-indent: -0.25in;"><br /></span>
<span style="text-indent: -0.25in;"> </span><span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;">grant change notification to HR; // </span></span><span style="text-indent: -0.25in;">might need your </span><span style="text-indent: -0.25in;">DBA's help.</span><br />
<span style="text-indent: -0.25in;"><br /></span>
<span style="text-indent: -0.25in;">1) Create a registration</span><br />
<span style="text-indent: -0.25in;"><br /></span>
<br />
<div style="text-indent: -24px;">
<span class="typ" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px;"></span><span class="typ" style="color: #660066; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"><span style="font-size: 14px;"> </span></span><span style="font-family: "courier new" , "courier" , monospace;"><span class="typ" style="color: #660066; font-size: 14px; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">OracleConnection</span><span class="pln" style="font-size: 14px; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"> conn </span><span class="pun" style="color: #666600; font-size: 14px; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">=</span><span class="pln" style="font-size: 14px; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"> ods.getConnection</span><span class="pun" style="color: #666600; font-size: 14px; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">();</span></span></div>
<div style="text-indent: -24px;">
<span class="typ" style="color: #660066; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> Properties</span></span><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"> prop </span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">=</span><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"> </span><span class="kwd" style="color: #000088; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">new</span><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"> </span><span class="typ" style="color: #660066; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">Properties</span><span class="pun" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"><span style="color: #666600;">();</span></span></span></div>
<div style="text-indent: -24px;">
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"><span style="color: #666600;"> </span>prop</span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">.</span><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">setProperty</span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">(</span><span class="typ" style="color: #660066; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">OracleConnection</span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">.</span><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">DCN_NOTIFY_ROWIDS</span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">,</span><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"> </span><span class="str" style="color: #008800; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">"true"</span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">);</span></span></div>
<div style="text-indent: -24px;">
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"><span style="color: #666600;"> </span>prop</span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">.</span><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">setProperty</span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">(</span><span class="typ" style="color: #660066; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">OracleConnection</span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">.</span><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">DCN_QUERY_CHANGE_NOTIFICATION</span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">,</span><span class="str" style="color: #008800; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">"true"</span><span class="pun" style="color: #666600; list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;">);</span><span class="pln" style="list-style: none outside none; margin: 0px; padding: 0px; text-indent: 0px; white-space: pre-wrap;"> </span></span></div>
<div style="text-indent: -24px;">
...</div>
<div style="text-indent: -24px;">
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">DatabaseChangeRegistration dcr = conn.registerDatabaseChangeNotifictaion(prop);</span></div>
<div>
<span class="com" style="color: #880000; list-style: none outside none; margin: 0px; padding: 0px;"> ...</span></div>
<span style="text-indent: -0.25in;"><br /></span>
<span style="text-indent: -0.25in;">2) Associate a query with the registration</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> Statement stmt = conn.createStatement(); </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> // associating the query with the registration</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> ((OracleStatement)stmt).setDatabaseChangeRegistration(dcr); </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> // any query that will be executed with the 'stmt' object will be associated with</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> // the registration 'dcr' until 'stmt' is closed or </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> // '((OracleStatement)stmt).setDatabaseChangeRegistration(null);' is executed.</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> ...</span><br />
<span style="text-indent: -0.25in;"><br /></span>
<span style="text-indent: -0.25in;"><br /></span><br />
<span style="text-indent: -0.25in;">3) Listen to the notification</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> ...</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> // Attach the listener to the registration. </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><span style="text-indent: -0.25in;"> // Note: DCNListener is a custom listener and not a predefined or standard </span></span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><span style="text-indent: -0.25in;"> // listener</span></span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> DCNListener list = new DCNListener();
dcr.addListener(list); </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; text-indent: -0.25in;"> ...</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> catch(SQLException ex)
{ </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> // if an exception occurs, we need to close the registration in order </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> // to interrupt the thread otherwise it will be hanging around. </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> if(conn != null) </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> conn.unregisterDatabaseChangeNotification(dcr); </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> throw ex; </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> }</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<i style="text-indent: -0.25in;"><br /></i><br />
<i style="text-indent: -0.25in;">ResultSets Caching with Change Notification - the Easy Way (JDBC Thin with DB 18c)</i><br />
<br />
You may also enable ResultSet caching with invalidation, in a much easier way, using the following<br />
<span style="text-indent: -0.25in;"> steps </span><span style="text-indent: -0.25in;">(once JDBC-Thin in Oracle database 18c is available on-premise).</span><br />
<br />
1) Set the following database parameters in the database configuration file also known as<br />
<span style="text-indent: -0.25in;">INIT.ORA.</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">CLIENT_RESULT_CACHE_SIZE=100M </span>// e.g., maximum cache size, in bytes<br />
<span style="text-indent: -0.25in;"><span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;">CLIENT_RESULT_CACHE_LAG=1000</span> </span>// m</span><span style="text-indent: -0.25in;">aximum delay for refreshing the </span><span style="text-indent: -0.25in;">cache </span><span style="text-indent: -0.25in;">(msec)</span><span style="text-indent: -0.25in;"> </span><br />
<span style="text-indent: -0.25in;"><br /></span>
<span style="text-indent: -0.25in;"><br /></span><br />
<span style="text-indent: -0.25in;">2) Set the JDBC connection property </span><span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">oracle.jdbc.enableQueryResultCache </span>to true (the default).</span><br />
<span style="text-indent: -0.25in;"><br /></span>
<span style="text-indent: -0.25in;"><br /></span><br />
<span style="text-indent: -0.25in;">3) add the following hint to the SQL query string "</span><span style="font-family: "courier new" , "courier" , monospace; text-indent: -0.25in;"><span style="font-size: x-small;">/*+ RESULT_CACHE */</span>"</span><br />
<span style="text-indent: -0.25in;"><br /></span>
<span style="text-indent: -0.25in;">Example "<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">SELECT </span></span><span style="font-size: x-small;"><span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace;">/</span></span><span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace;">*+ RESULT_CACHE */ </span></span><span style="font-family: "courier new" , "courier" , monospace; text-indent: -0.25in;">product_name, unit_price </span></span><br />
<span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> FROM PRODUCTS WHERE unit_price > 100"</span></span><span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace;"><br /></span></span><br />
<span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace;"><span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">If changing the Java/JDBC source code to add the SQL hint is not an option, you can instruct the</span></span></span><br />
<span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace;"><span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;"> RDBMS to cache </span></span></span><span style="text-indent: -0.25in;"><span style="font-family: "times" , "times new roman" , serif;">the ResultSets of all </span></span><span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">queries related to a specific table, either at table creation </span><br />
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">(default mode) or later </span><span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">(force mode); this is called</span><span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;"> Table annotation.</span><br />
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">Examples </span><span style="font-family: "courier new" , "courier" , monospace; text-indent: -0.25in;"> </span><br />
<span style="font-family: "courier new" , "courier" , monospace; text-indent: -0.25in;"><br /></span><i style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">CREATE TABLE products (...) RESULT_CACHE (MODE DEFAULT);</span></i><br />
<span style="font-size: x-small;"><span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace;"> ALTER TABLE products RESULT_CACHE (MODE FORCE);</span></span></span><br />
<br />
The RDBMS furnishes views such as the <span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">V$RESULT_CACHE_STATISTICS</span></span><span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace;"> </span>and</span><br />
<span style="text-indent: -0.25in;">a </span><span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">CLIENT_RESULT_CACHE_STATS$</span> table for monitoring the effectiveness of ResultSet caching.</span><br />
<span style="text-indent: -0.25in;">See section 15 in the <a href="https://docs.oracle.com/en/database/oracle/oracle-database/12.2/tgdba/database-performance-tuning-guide.pdf">performance </a></span><a href="https://docs.oracle.com/en/database/oracle/oracle-database/12.2/tgdba/database-performance-tuning-guide.pdf" style="text-indent: -0.25in;">tuning guide</a> for <span style="text-indent: -0.25in;">more details on configuring the server-side </span><br />
<span style="text-indent: -0.25in;">result</span><span style="text-indent: -0.25in;"> </span><span style="text-indent: -0.25in;">set cache</span><br />
<br />
<i>Array Fetch</i><br />
<br />
Array fetching is an absolute necessity when retrieving a large number of rows from a ResultSet.<br />
The fetch size can be specified on <span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">Statement, PreparedStatement, </span></span><span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">CallableStatement</span>, and </span><br />
<span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">ResultSet </span></span><span style="text-indent: -0.25in;">objects.</span><br />
<span style="text-indent: -0.25in;"><span style="font-family: "times" , "times new roman" , serif;">Example:</span><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> pstmt.setFetchSize(20);</span></span><br />
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;"><span style="text-indent: -0.25in;"><br /></span></span>
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;"><span style="text-indent: -0.25in;"><br /></span></span><br />
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;"><span style="text-indent: -0.25in;">When using the Oracle database, this array size is capped by the RDBMS's internal buffer known as</span></span><br />
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">Session Data Unit (SDU). The SDU buffer is used for transferring </span><span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">data </span><span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">from the tables to the </span><span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">client, </span><br />
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">over the network. </span><span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">The size of this buffer, in bytes, can be specified </span><span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">in JDBC URL</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> jdbc:oracle:thin:@(DESCRIPTION=(SDU=10240)<span style="white-space: pre;"> </span></span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> (ADDRESS=(PROTOCOL=tcp)(HOST=myhost-vip)(PORT=1521))<span style="white-space: pre;"> </span></span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> (CONNECT_DATA=(SERVICE_NAME=myorcldbservicename)))</span><br />
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;"><br /></span><br />
<span style="font-family: "times" , "times new roman" , serif; text-indent: -0.25in;">or at the service level in Net Services configuration files </span><span style="text-indent: -0.25in;"><span style="font-family: "courier new" , "courier" , monospace;">sqlnet.ora and tnsnames.ora.</span></span><br />
There is a hard limit depending on the RDBMS release: <span style="text-indent: -0.25in;">2MB with DB </span><span style="text-indent: -0.25in;">12c, </span><span style="text-indent: -0.25in;">64K </span>with DB <span style="text-indent: -0.25in;">11.2,</span><br />
<span style="text-indent: -0.25in;"> and </span><span style="text-indent: -0.25in;">32K </span><span style="text-indent: -0.25in;">with</span><span style="text-indent: -0.25in;"> DB pre-11.2.</span><span style="text-indent: -0.25in; white-space: pre;"> </span><br />
<span style="text-indent: -0.25in; white-space: pre;">In summary, even if you set the array fetch to a large number, it cannot retrieve more data than </span><br />
<span style="text-indent: -0.25in; white-space: pre;">the </span><span style="text-indent: -0.25in; white-space: pre;">SDU permits.</span><br />
<i><br /></i>
<i>Array DML (Update Batch)</i><br />
<br />
The JDBC specification defines array operations as sending a batch of the same DML operations<br />
(i.e., <span style="text-indent: -0.25in;">array INSERTs, array</span><span style="text-indent: -0.25in;"> UPDATEs, array DELETE) for sequential execution at the server, </span><br />
<span style="text-indent: -0.25in;">thereby</span><span style="text-indent: -0.25in;"> reducing </span><span style="text-indent: -0.25in;">network round-trips</span><span style="text-indent: -0.25in;">.</span><br />
<span style="text-indent: -0.25in;"><br /></span>
<span style="text-indent: -0.25in;">Update Batching consists in </span><span style="text-indent: -0.25in;">explicitly invoking the <span style="font-family: "courier new" , "courier" , monospace;">addBatch</span> methods which adds a statement to</span><br />
<span style="text-indent: -0.25in;"> an </span><span style="text-indent: -0.25in;">array</span><span style="text-indent: -0.25in;"> operation then </span><span style="text-indent: -0.25in;">explicitly calling executeBatch
method.</span><span style="text-indent: -0.25in;"> </span><br />
<br />
...<br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> PreparedStatement pstmt =</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> conn.prepareStatement("INSERT INTO employees VALUES(?, ?)");</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">pstmt.setInt(1, 2000);</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">pstmt.setString(2, "Milo Mumford");</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">pstmt.addBatch();</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">pstmt.setInt(1, 3000);</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">pstmt.setString(2, "Sulu Simpson");</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">pstmt.addBatch();</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">int[] updateCounts = pstmt.executeBatch();</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><span style="text-indent: -0.25in;"></span></span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">...</span></div>
<!--StartFragment-->
<!--EndFragment--><br />
<div style="text-align: left;">
</div>
<h4 style="text-align: left;">
Optimizing Network Traffic</h4>
<div>
<br /></div>
<span style="font-weight: normal;"><i>Network Data Compression</i></span><br />
<span style="font-weight: normal;"><i><br /></i></span>
<span style="font-weight: normal;">The ability to <a href="https://docs.oracle.com/en/database/oracle/oracle-database/12.2/jjdbc/data-sources-and-URLs.html#GUID-6D8EFA50-AB0F-4A2B-88A0-45B4A67C361E">compress data transmitted between the Java applications and the RDBMS </a>over LAN or WAN reduces the volume of data, the transfert time and the number of roundtrips.</span><br />
<span style="font-weight: normal;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; font-weight: normal;">// Enabling Network Compression </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; font-weight: normal;">prop.setProperty("oracle.net.networkCompression","on"); </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; font-weight: normal;">// Optional configuration for setting the client compression threshold.</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; font-weight: normal;">prop.setProperty("oracle.net.networkCompressionThreshold","1024");
ds.setConnectionProperties(prop); </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; font-weight: normal;">ds.setURL(url); </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; font-weight: normal;">Connection conn = ds.getConnection(); </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; font-weight: normal;">...</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small; font-weight: normal;"><br /></span>
<span style="font-weight: normal;"><i>Sessions Multiplexing </i></span><span style="font-weight: normal;"><br />
</span><br />
<span style="font-weight: normal;"><br /></span>
<span style="font-weight: normal;">The Oracle database Connection Manager a.k.a. CMAN, </span>furnishes the ability to funnel multiple database connections over a single network connection thereby saving OS resources.<br />
See more details in the <a href="https://docs.oracle.com/en/database/oracle/oracle-database/18/netag/net-services-administrators-guide.pdf">Net Services Admin guide</a>.<br />
<br />
<div style="text-align: left;">
</div>
<h4 style="text-align: left;">
In-Place Processing</h4>
<div>
<br /></div>
<span style="font-weight: normal;">As we have seen earlier, SQL statements execution involves a number of roundtrips between a database client i.e., Java mid-tier/web-server and the RDBMS; this is the rationales for using stored procedures. Even modern data processing such as Hadoop or Spark, collocate the processing and data for low latency.</span><br />
<span style="font-weight: normal;">All RDBMSes furnish stored procedures in various languages including proprietary procedural language such as Oracles PL/SQL but also Java, JavaScript, even PHP, Perl, Python, and TCL.</span><br />
<span style="font-weight: normal;">I discussed the pros and cons of stored procedures in chapter 1 of <a href="http://www.amazon.com/exec/obidos/ASIN/1555583296">my book</a>.</span><br />
<span style="font-weight: normal;">I'd add that in a modern micro-services based architecture, stored procedures are perfect for designing data-bound services.</span><br />
<span style="font-weight: normal;">The Oracle database furnishes Java and </span><span style="font-weight: normal;"><a href="https://github.com/oracle/oracle-db-examples/tree/master/plsql">PL/SQL stored procedures</a>. Java in the database is one of the best Oracle database gem; see <a href="https://github.com/oracle/oracle-db-examples/tree/master/java/ojvm">some code samples on GitHub.</a></span><br />
<br />
<h3 style="text-align: left;">
Scaling Out Java Applications that use an RDBMS</h3>
<div>
<br /></div>
<div>
In this section, I will discuss scaling Java applications using Sharded databases, Multitenant databases, database proxy and the upcoming asynchronous Java database access API.<br />
<br /></div>
<div>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
Horizontal Scaling of Java applications with Sharded Databases</h4>
<br />
Sharded database have been around for a while; think of shards as horizontal partitioning of tables across several databases (iow, partitions on steroids!).<br />
The main impact for developers is that Java application must be Shard-aware; iow, the requirement to: (i) define which fields serve as sharding key, (ii) set the binding values and build the sharding key (and optionally, the super sharding key) before requesting a connection to the datasource. RDBMS vendors are actively working on a routing capability which will remove shard-awareness (see database proxy, later in this post).<br />
<br />
Java SE 9 furnishes the <a href="https://docs.oracle.com/javase/9/docs/api/java/sql/ShardingKey.html">standard APIs </a>for building the sharding and supersharding keys.<br />
<pre style="background-color: white; color: #474747; font-family: "DejaVu Sans Mono", monospace; font-size: 14px;"><code style="font-family: "DejaVu Sans Mono", monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;">
</code></pre>
<pre style="background-color: white; color: #474747; font-family: "DejaVu Sans Mono", monospace; font-size: 14px;"><code style="font-family: "DejaVu Sans Mono", monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;">DataSource ds = new MyDataSource();
ShardingKey shardingKey = ds.createShardingKeyBuilder()
.subkey("abc", JDBCType.VARCHAR)
.subkey(94002, JDBCType.INTEGER)
.build();</code></pre>
<pre style="background-color: white; color: #474747; font-family: "DejaVu Sans Mono", monospace; font-size: 14px;"><code style="font-family: "DejaVu Sans Mono", monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;"><pre style="font-family: "DejaVu Sans Mono", monospace;"><code style="font-family: "DejaVu Sans Mono", monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;"> ...</code></pre>
<pre style="font-family: "DejaVu Sans Mono", monospace;"><code style="font-family: "DejaVu Sans Mono", monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;"> Connection con = ds.createConnectionBuilder()
.shardingKey(shardingKey)
.build();</code></pre>
</code></pre>
<br />
Depending on the RDBMS implementation, the map of shards keys across all shard, also know as "<i>shard topology</i>" is maintained by an external mechanism known as the "<i>Shard Director</i>" (in Oracle database implementation). Without further optimization, all connection requests (with a mandatory sharding key) go to the Shard Director which finds the corresponding shard then a connection is established with that shard.<br />
<br />
<i>A Shared Pool for Sharded DBs</i><br />
<i><br /></i>
The Oracle Universal Connection Pool (UCP) furnishes a shared single pool for all shards.<br />
UCP has been enhanced to transparently suck the shard map (i.e., all the keys that map to a specific shard), from the Shard Director, during the first connection to a specific shard. Once UCP gets the keys range, it no longer needs to go to the Shard Director for subsequent connections requests related to that shard. After a little while, assuming your Java application randomly accesses all shards, UCP will get the entire shard topology from the Shard Director. A high availability byproduct of UCP acting as the Shard Director is that shard-aware Java applications can work even if the Shard Director is down.<br />
<br /></div>
<div>
<h4 style="text-align: left;">
Scaling Java Applications with Multi-Tenant Databases</h4>
<div>
<br /></div>
Multi-tenancy is a key business requirement for enterprise Java applications. It could be simulated at the application level but true Multi-tenancy requires a Multi-tenant RDBMS where each tenant has it's own database.<br />
Multi-tenant RDBMS scale by managing thousands of databases with one of very few database instances (an instance being the set of processes and memory structures necessary for managing a database), thereby reducing drastically the required computing resources.<br />
<br />
<i>How would Java applications scale with Multi-Tenant RDBMS?</i><br />
<br />
A non Multi-tenant aware connection pool would allocate a pool per database, defeating the purpose. UCP has been enhanced to use a single shared pool for all pluggable databases -- a.k.a. PDB (a PDB is the tenant specific database in Oracle's Multi-tenant architecture). <br />
Upon a connection request to a specific PDB, if there is no free/available connection attached to that tenant database, UCP transparently repurposes an idle connection in the pool, which was attached to another PDB to be re-attached to this one, thereby allowing to use a small set of pooled connections to service all tenants while avoiding new connection creation (remember, this is very expensive!) and preserving system resources.<br />
See <a href="https://docs.oracle.com/en/database/oracle/oracle-database/12.2/jjucp/shared-pool-for-multitenant-data-sources.html#GUID-7C397AA8-9C78-4DB0-AAF4-15BBF9AFFB85">the UCP doc</a> for more details on using one datasource per tenant or a single datasource for all tenants.<br />
<br />
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
Database proxy </h4>
<div>
<br /></div>
<div>
Proxies are man-in-the-middle software running between the database and its clients e.g., Java applications. There are several proxy offerings on the market; to name a few: <a href="https://dev.mysql.com/doc/mysql-router/8.0/en/" style="text-indent: -0.25in;">MySQL Router</a><span style="text-indent: -0.25in;">, the Oracle Database Connection </span><span style="text-indent: -0.25in;">Manager </span><span style="text-indent: -0.25in;">in Traffic Director Mode (<a href="http://www.oracle.com/technetwork/database/enterprise-edition/cman-overview-084817.html">CMAN-TDM</a>), ProxySQL, and so on.<br />The Oracle CMAN-TDM is new in Oracle database 18c; it is an extension of the existing Oracle Connection Manager a.k.a. CMAN and furnishes these new following capabilities</span></div>
<div>
<ul style="text-align: left;">
<li>Fully transparent to applications</li>
<li>Routes database traffic to right instance (planned)</li>
<li>Hides database planned and unplanned outages to support zero application downtime</li>
<li>Optimizes database session usage and application performance </li>
<li>Enhances database security</li>
</ul>
<div>
CMAN-TDM is client agnostic, iow, it supports all database clients applications including: Java, C, C++, DotNET, Node.js, Python, Ruby, R.</div>
<div>
Java applications would connect to CMAN-TDM which, in its turn, connects to the database using the latest driver and libraries then transparently furnish the Quality of Service that the application would get <u>only if it was using the latest driver and APIs</u>. </div>
<div>
<br /></div>
See more details in the <a href="http://www.oracle.com/technetwork/database/enterprise-edition/cman-overview-084817.html">CMAN landing page</a> and the Net Services documentions linked from the landing page.<br />
<br /></div>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
</h4>
<h4 style="text-align: left;">
Asynchronous Java Database Access API (ADBA)</h4>
<div>
<br /></div>
<div style="text-align: left;">
<span style="font-weight: normal;">The existing JDBC API leads to blocked threads, threads scheduling, and contention; it is not suitable for</span> <span style="font-weight: normal;">reactive applications or </span><span style="font-weight: normal;">high throughput and large-scale deployments. There exist non-standard asynchronous Java database access APIs but the Java community needs a standard one where user threads never block. User threads submit database operations and return; the API implementation takes care of executing the operations, independently of user threads.</span></div>
<div style="text-align: left;">
<div style="text-align: left;">
<div style="text-align: left;">
<span style="font-weight: normal;">This new API proposal is not intended to be an extension to, or a replacement for, JDBC but, rather, an entirely separate API that provides completely nonblocking access to the same databases as JDBC.</span><br />
<span style="font-weight: normal;"><br /></span>
<br />
<div style="text-align: left;">
<span style="font-weight: normal;">The new API proposal relies on the <span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">java.util.concurrent.CompletionStage</span> interface; it is available for download from the OpenJDK sandbox @ </span><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">http://tinyurl.com/java-async-db.</span></div>
<span style="font-family: "times" , "times new roman" , serif;">You can sed some examples in the latest JavaOne presentation @ </span><span style="font-family: "courier new" , "courier" , monospace;">http://bit.ly/2wi948k</span>.<br />
<br />
<div style="text-align: left;">
There was a suggestion on the mailing list <span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: x-small;">http://mail.openjdk.java.net/pipermail/jdbc-spec-discuss/ </span></span>to rather base he API on the Reactive Streams class <span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">java.util.concurrent.Flow</span>; you can follow that discussion in the mailing list.</div>
<div style="text-align: left;">
<br />
I would encourage all the readers of this blog to review the API and get involved in the discussion.<br />
<br />
<i>ADBA over JDBC</i><br />
<br />
In order to help the community get a feel of ADBA, an alpha version of it that runs over the vanilla/synchronous JDBC -- that we are calling AoJ for ADBA over JDBC -- @ https://github.com/oracle/oracle-db-examples/tree/master/java/AoJ</div>
</div>
</div>
</div>
<h4 style="text-align: left;">
<div style="text-align: left;">
<div style="text-align: left;">
<h3 style="text-align: left;">
</h3>
<h3 style="text-align: left;">
Resources</h3>
</div>
</div>
</h4>
</div>
<div>
<br />
<a href="https://docs.oracle.com/en/database/oracle/oracle-database/18/jjdbc/jdbc-developers-guide.pdf">Oracle DB18c JDBC driver </a></div>
<div>
<a href="http://www.oracle.com/technetwork/database/application-development/jdbc/jdbcanducp122-3628966.pdf">Performance, Scalability, and High-Availability with JDBC and UCP in Oracle Database 12c </a></div>
</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com49tag:blogger.com,1999:blog-25155671.post-55849745901988228812017-11-06T20:15:00.002-08:002017-11-06T20:15:16.930-08:00Slides of my JavaOne and OOW 2017 sessions<div dir="ltr" style="text-align: left;" trbidi="on">
The slides of my <a href="http://db360.blogspot.com/2017/09/my-sessions-recommendations-for-javaone.html"><b>recommended JavaOne 2017 and OOW2017 sessions</b></a> are available <a href="http://www.oracle.com/technetwork/database/application-development/jdbc/overview/oow-j1-2017-3959528.html"><b>here</b></a>.</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com19tag:blogger.com,1999:blog-25155671.post-34383170247894107782017-09-04T11:00:00.002-07:002017-09-18T10:22:55.646-07:00My Sessions Recommendations for JavaOne and Oracle Open World 2017<div dir="ltr" style="text-align: left;" trbidi="on">
Good Day,<br />
<br />
JavaOne, and Oracle Open World are 4 exactly weeks away.<br />
<br />
Here are some sessions related to Java, JDBC, OJVM (database embedded JVM), JavaScript Nashorn (JavaSCript data access, JavaScript stored procedures), Apache Spark, Apache Hadoop, Apache Flink, Apache Beam that I'd warmly recommend.<br />
<br />
<h3 style="text-align: left;">
JavaOne 2017 Sessions Recommendations</h3>
<br />
<ul style="text-align: left;">
<li> <a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogjavaone17?search=CON1491&showEnrolled=false">JDBC Next: A New Asynchronous API for Connecting to a Database</a><br />Tuesday, Oct 03, 11:00 a.m. - 11:45 a.m. | Moscone West - Room 2020</li>
<li><a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogjavaone17?search=CON1616&showEnrolled=false">A RESTful Java framework for Asynchronous High Speed Ingest</a><br />Thursday, Oct 05, 10:45 a.m. - 11:30 a.m. | Marriott Marquis (Yerba Buena Level) - Nob Hill A/B</li>
<li><a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogjavaone17?search=CON1615&showEnrolled=false">Security Policy File Best Practices for your Java/JDBC Modules</a><br />Monday, Oct 02, 12:15 p.m. - 1:00 p.m. | Moscone West - Room 2022</li>
<li><a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogjavaone17?search=CON1493&showEnrolled=false">Portable Database Access for JavaScript Applications, using Java 8 Nashorn</a><br />Wednesday, Oct 04, 8:30 a.m. - 9:15 a.m. | Moscone West - Room 2024</li>
<li><a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogjavaone17?search=CON1495&showEnrolled=false">Turning Relational Database Tables into Spark Data Sources</a><br />Wednesday, Oct 04, 9:30 a.m. - 10:15 a.m. | Moscone West - Room 2005</li>
<li><a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogjavaone17?search=BOF3424&showEnrolled=false">No More Duplicate Transactions: a Java API for At Most Once COMMIT</a><br />Monday, Oct 02, 6:30 p.m. - 7:15 p.m. | Moscone West - Room 2024</li>
</ul>
<h3 style="text-align: left;">
OpenWorld 2017 Sessions Recommendations</h3>
<div>
<ul style="text-align: left;">
<li><a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogjavaone17?search=CON4327&showEnrolled=false">Java Best Practices for Developing and Deploying Against Databases in the Cloud</a><br />Thursday, Oct 05, 12:45 pm - 1:30pm | Marriott Marquis - Golden Gate C3</li>
<li><a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogoow17?search=CON6707&showEnrolled=false">Best Practices for Speeding and Scaling Java Applications</a><br />Monday, Oct 02, 5:45 p.m. - 6:30 p.m. | Moscone West - Room 3010</li>
<li><a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogoow17?search=CON6730&showEnrolled=false">Multitenancy and Continuous Availability for Java Applications</a><br />Tuesday, Oct 03, 5:45 p.m. - 6:30 p.m. | Moscone West - Room 3010</li>
<li><a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogoow17?search=CON6709&showEnrolled=false">Hadoop, Spark, Flink, and Beam Explained to Oracle DBAs: Why They Should Care</a><br />Wednesday, Oct 04, 4:30 p.m. - 5:15 p.m. | Moscone West - Room 3010</li>
<li><a href="https://events.rainfocus.com/catalog/oracle/oow17/catalogoow17?search=CON6732&showEnrolled=false">JavaScript Programming with Oracle Database 12c Using Nashorn Across Tiers</a><br />Wednesday, Oct 04, 5:30 p.m. - 6:15 p.m. | Moscone West - Room 3010</li>
</ul>
</div>
</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com90tag:blogger.com,1999:blog-25155671.post-37387007172538226422017-05-26T15:43:00.001-07:002017-08-08T10:12:50.302-07:00Carbonated Java & JavaScript Stored Procedures <div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
Carbonated Java Stored Procedures</h3>
For accessing JSON Collections and documents without any knowledge of SQL, Oracle furnishes the SODA for Java API. It allows a convenient access and navigation using the dot notation.<br />
<br />
How to use <i>SODA for Java </i>in Java Stored Procedures? I have posted the steps, the code samples and scripts on <a href="https://github.com/oracle/oracle-db-examples/blob/master/java/ojvm/SODA.md">GitHub</a>.<br />
<h3 style="text-align: left;">
Carbonated JavaScript Stored Procedures </h3>
Nashorn allows interoperability between Java and javaScript. By leveraging such interoperability, I've been able to reuse SODA for Java with JavaScript Stored Procedures.<br />
<br />
How to use <i>SODA for Java </i>in JavaScript Stored Procedures? I have posted the steps, the code samples and scripts on <a href="https://github.com/oracle/oracle-db-examples/blob/master/javascript/nashorn/SODAjs.md">GitHub</a>.<br />
<br />
Enjoy!</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com2tag:blogger.com,1999:blog-25155671.post-91365957834892739292017-03-02T17:53:00.003-08:002017-08-08T10:10:53.619-07:00What's in Oracle Database 12c Release 2 for Java & JavaScript Developers?<div dir="ltr" style="text-align: left;" trbidi="on">
<strong style="-webkit-font-smoothing: antialiased; background-color: white; font-family: arial, helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px;">Here is the summary of New Java & JavaScript Features in Oracle Database 12c Release 2 on Cloud and on-Premise</strong><span style="background-color: white; font-family: "arial" , "helvetica" , sans-serif; font-size: 12px;"></span><br />
<ul style="-webkit-font-smoothing: antialiased; background-color: white; font-family: arial, helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="-webkit-font-smoothing: antialiased; background: url("/assets/css/list-icons.png") -266px -129px no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><strong style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px; padding: 0px;">Java 8:</strong> Java 8 in JDBC/UCP and OJVM; JDBC 4.2</li>
<li style="-webkit-font-smoothing: antialiased; background: url("/assets/css/list-icons.png") -266px -129px no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><strong style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px; padding: 0px;">JavaScript with Nashorn</strong>: JDBC/UCP, OJVM</li>
<li style="-webkit-font-smoothing: antialiased; background: url("/assets/css/list-icons.png") -266px -129px no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><strong style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px; padding: 0px;">Performance: </strong>JIT (OJVM), Network Compression over WAN (JDBC), Configurable connection health check frequency (UCP), PL/SQL Callback interface (JDBC)</li>
<li style="-webkit-font-smoothing: antialiased; background: url("/assets/css/list-icons.png") -266px -129px no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><strong style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px; padding: 0px;">Scalability</strong>: Shared Pool for Multi-Tenant Database (UCP), Shared Pool for Sharded database (UCP), Sharding Key APIs (JDBC, UCP), DRCP Proxy session sharing, DRCP support for multiple labels</li>
<li style="-webkit-font-smoothing: antialiased; background: url("/assets/css/list-icons.png") -266px -129px no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><strong style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px; padding: 0px;">High-Availability</strong>: Java APIs for FAN events (SimpleFan.jar), Planned Maintenance in the driver (JDBC), Application Continuity for XA Datasources, Transaction Guard for XA Datasource</li>
<li style="-webkit-font-smoothing: antialiased; background: url("/assets/css/list-icons.png") -266px -129px no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><strong style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px; padding: 0px;">Security:</strong> SSL v1.2 / TLS v 1.2 (JDBC)</li>
<li style="-webkit-font-smoothing: antialiased; background: url("/assets/css/list-icons.png") -266px -129px no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><strong style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px; padding: 0px;">Manageability</strong>: XMLconfiguration (UCP), Enable/disable/suspend/resume feature level logging (JDBC), MAX_THINK_TIME for Transactions in progress (DRCP), new statistics view and AWR reports </li>
<li style="-webkit-font-smoothing: antialiased; background: url("/assets/css/list-icons.png") -266px -129px no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><strong style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px; padding: 0px;">Ease of Use :</strong> Web Services Callout (OJVM), Long Identifiers (OJVM), PL/SQL Boolean (JDBC), Debugger for OJVM (<span class="segment" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px; padding: 0px; text-indent: -0.25in;"><span style="color: #222222; font-family: "tahoma" , sans-serif; list-style: none; margin: 0px; padding: 0px;">Java Debug Wire Protocol)</span></span></li>
</ul>
<strong style="-webkit-font-smoothing: antialiased; background-color: white; font-family: arial, helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px;"><span style="color: red;">See our latest <a href="http://www.oracle.com/technetwork/database/application-development/java-development-oracle-db12cr2-3615586.pdf" style="-webkit-font-smoothing: antialiased; list-style: none; margin: 0px; padding: 0px; text-decoration: none;" target="">white paper</a> for more details.</span></strong></div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com6tag:blogger.com,1999:blog-25155671.post-29361404708744703232016-12-02T11:53:00.002-08:002016-12-02T13:43:55.864-08:00My Talks/Sessions at UKOUG Tech16<div dir="ltr" style="text-align: left;" trbidi="on">
Hi guys,<br />
<br />
If you plan to attend UKOUG Tech16, please check out my talks.sessions<br />
<br />
<div style="text-align: left;">
</div>
<ol style="text-align: left;">
<li> <b>Sunday 12/04 16:10 </b><i>New JDBC & UCP Perf, Scalability & HA features in <span style="background-color: #f5f8fa; color: #292f33; font-family: "arial" , sans-serif; font-size: 16px; white-space: pre-wrap;"> Oracle Database 12c</span></i><span style="background-color: #f5f8fa; color: #292f33; font-family: "arial" , sans-serif; font-size: 16px; white-space: pre-wrap;"><i>R2 @</i> </span><span style="color: #0084b4; font-family: "arial" , sans-serif;"><span class="tco-ellipsis" style="background: rgb(245, 248, 250); white-space: pre-wrap;"></span></span><a class="twitter-timeline-link" data-expanded-url="http://bit.ly/2f9m0ZA" dir="ltr" href="https://t.co/lVouB5dHoe" rel="nofollow" style="background: rgb(245, 248, 250); color: #0084b4; font-family: Arial, sans-serif; font-size: 16px; text-decoration: none; white-space: pre-wrap;" target="_blank" title="http://bit.ly/2f9m0ZA"><span class="invisible" style="background: rgb(245, 248, 250); color: #0084b4; font-family: "arial" , sans-serif; font-size: 0px; line-height: 0; text-decoration: none; white-space: pre-wrap;">http://</span><span class="js-display-url" style="background: rgb(245, 248, 250); color: #0084b4; font-family: "arial" , sans-serif; font-size: 16px; text-decoration: none; white-space: pre-wrap;">bit.ly/2f9m0ZA</span></a><br /></li>
<li><b>Monday 12/05 17:55</b> <i>A RESTful MicroService for JSON Processing in Oracle Database 12c R2 @</i> <a class="twitter-timeline-link" data-expanded-url="http://bit.ly/2gqmfgB" dir="ltr" href="https://t.co/w56hYSW90Z" rel="nofollow" style="background: rgb(245, 248, 250); color: #0084b4; font-family: Arial, sans-serif; font-size: 16px; text-decoration: none; white-space: pre-wrap;" target="_blank" title="http://bit.ly/2gqmfgB"><span class="js-display-url">bit.ly/2gqmfgB</span><span class="invisible" style="font-size: 0px; line-height: 0;"></span><span class="tco-ellipsis"><span class="invisible" style="font-size: 0px; line-height: 0;"> </span></span></a><span style="background-color: #f5f8fa; color: #292f33; font-family: "arial" , sans-serif; font-size: 16px; white-space: pre-wrap;">
</span></li>
<li><span style="background-color: #f5f8fa; color: #292f33; font-family: "arial" , sans-serif; font-size: 16px; white-space: pre-wrap;"><b><b style="color: black; font-family: "Times New Roman"; font-size: medium; white-space: normal;">Wednesday 12/07 8:50</b></b> </span><span class="invisible" style="background: rgb(245 , 248 , 250); color: #1da1f2; font-family: "arial" , sans-serif; font-size: 0px; letter-spacing: 0.26px; line-height: 0; outline: 0px; white-space: pre-wrap;">12</span><i>Hadoop, Spark & Flink Explained to Oracle DBAs & why They Should Care @ https://t.co/7CGLchAYAF<br /></i></li>
<li><b>Wednesday 12/07 15:10</b><i> Integrate BigData with Master Data: Oracle database table as Hadoop Datasource</i> @<span style="background-color: #f5f8fa; color: #292f33; font-family: "arial" , sans-serif; font-size: 16px; white-space: pre-wrap;"> </span><a class="twitter-timeline-link" data-expanded-url="http://bit.ly/2gzwU8w" dir="ltr" href="https://t.co/zSSaCj23yN" rel="nofollow" style="background: rgb(245, 248, 250); color: #0084b4; font-family: Arial, sans-serif; font-size: 16px; text-decoration: none; white-space: pre-wrap;" target="_blank" title="http://bit.ly/2gzwU8w"><span class="tco-ellipsis"></span><span class="invisible" style="font-size: 0px; line-height: 0;">http://</span><span class="js-display-url">bit.ly/2gzwU8w</span><span class="invisible" style="font-size: 0px; line-height: 0;"></span><span class="tco-ellipsis"><span class="invisible" style="font-size: 0px; line-height: 0;"> </span></span></a><span style="background-color: #f5f8fa; color: #292f33; font-family: "arial" , sans-serif; font-size: 16px; white-space: pre-wrap;"> </span></li>
</ol>
<span style="background-color: #f5f8fa; color: #292f33; font-family: "arial" , sans-serif; font-size: 16px; white-space: pre-wrap;">See you there</span><br />
<br />
<br />
<br /></div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com1tag:blogger.com,1999:blog-25155671.post-64848284956616759082016-11-09T08:41:00.002-08:002017-04-05T11:53:00.700-07:00REST Enable Java or JavaScript in the Database<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
REST Enable Java or JavaScript in the Database</h2>
<div>
The Oracle REST Data Service (ORDS) allows you to turn Java stored procedures or JavaScript stored procedures into REST Web Services that you may publish these in the Oracle REST Data Service.</div>
<div>
See more details @ http://www.oracle.com/technetwork/developer-tools/rest-data-services/overview/index.html<br />
<h3>
Prerequisite</h3>
This article assumes you've already loaded your Java or JavaScript code in the Oracle database 12c Release 2 (for JavaScript); for Java, any supported database release will do (Oracle has been supporting Java in the database since version 8<i>i.</i>)<br />
This <a href="http://db360.blogspot.com/2016/11/javascript-in-oracle-database-12c.html">blog post </a>describes how to load and run JavaScript in Oracle database 12c Release 12.2.</div>
<h3 style="text-align: left;">
<span style="color: #707070; font-family: "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="background-color: white; font-size: 18px;">Download and Configure ORDS</span></span></h3>
<div>
<b>1) First step</b>: download the latest ORDS @ http://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/index.html</div>
<div>
<br /></div>
<div>
<b>2) Extract the zip file </b>in a directory say ..<span style="font-family: monospace;">/ords.3.0.8</span></div>
<div>
<span style="font-family: monospace;"><br /></span></div>
<div>
<b>3) Configure and Install</b></div>
<div>
<br /></div>
<div>
<strong><span style="color: red;">$ ls </span></strong></div>
<div>
docs logs params
examples ords.war readme.html<br />
<span style="font-family: monospace;"><span style="white-space: pre;"><br /></span></span>Navigate into <code>params</code> directory and edit the <code>ords_params.properties</code> file. <br />
Modify the <code>standalone.http.port</code> value to a desired port # (e.g., <code>8090)</code> and save the file.<br />
<kbd><br /></kbd>
<kbd><span style="color: red;">$vi params/ords_params.properties</span></kbd><br />
<pre class="collapsible" data-view-label="View Output"><code><strong>#</strong>Tue Jul 26 05:23:16 UTC 2016
db.hostname=
db.port=
db.servicename=
db.sid=
db.username=APEX_PUBLIC_USER
migrate.apex.rest=false
rest.services.apex.add=
rest.services.ords.add=true
schema.tablespace.default=SYSAUX
schema.tablespace.temp=TEMP
standalone.http.port=<strong>8090</strong>
standalone.static.images=
user.tablespace.default=USERS
user.tablespace.temp=TEMP
~
~
~
~
~ </code></pre>
<pre class="collapsible" data-view-label="View Output"><code>"params/ords_params.properties" 17L, 467C 1,1 All<strong></strong></code></pre>
<pre class="collapsible" data-view-label="View Output"><code>
</code></pre>
<strong>Note: </strong>Do not modify any other property<br />
<br />
<pre><span style="color: red;">$ <strong>java -jar ords.war</strong></span>
This Oracle REST Data Services instance has not yet been configured.
Please complete the following prompts
Enter the location to store configuration data:<strong>/u01/oracle/ords.3.0.6/ordsi</strong>
Enter the name of the database server [localhost]:
Enter the database listen port [1521]:
Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
Enter the database service name:<strong>pdb1</strong>
Enter the database password for ORDS_PUBLIC_USER:
Confirm password:
Please login with SYSDBA privileges to verify Oracle REST Data Services schema.
Enter the username with SYSDBA privileges to verify the installation [SYS]:
Enter the database password for SYS:<strong>Welcome1</strong>
Confirm password:<strong>Welcome1</strong>
Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]:<strong>2</strong>
Sep 07, 2016 3:53:19 AM oracle.dbtools.common.config.file.ConfigurationFilesBase update
INFO: Updated configurations: defaults, apex_pu
Installing Oracle REST Data Services version 3.0.6.176.08.46
... Log file written to /u01/oracle/ords.3.0.6/logs/ords_install_core_2016-09-07_035319_00534.log
... Verified database prerequisites
... Created Oracle REST Data Services schema
... Created Oracle REST Data Services proxy user
... Granted privileges to Oracle REST Data Services
... Created Oracle REST Data Services database objects
... Log file written to /u01/oracle/ords.3.0.6/logs/ords_install_datamodel_2016-09-07_035342_00050.log
Completed installation for Oracle REST Data Services version 3.0.6.176.08.46. Elapsed time: 00:00:23.840
Enter 1 if you wish to start in standalone mode or 2 to exit [1]:<strong>1</strong>
Enter 1 if using HTTP or 2 if using HTTPS [1]:<strong>1</strong>
2016-09-07 03:54:28.867:INFO::main: Logging initialized @158428ms
Sep 07, 2016 3:54:29 AM oracle.dbtools.standalone.StandaloneJetty setupDocRoot
INFO: Disabling document root because the specified folder does not exist: /u01/oracle/ords.3.0.6/ordsi/ords/standalone/doc_root
2016-09-07 03:54:29.525:INFO:oejs.Server:main: jetty-9.2.z-SNAPSHOT
Sep 07, 2016 3:54:29 AM oracle.dbtools.auth.crypto.CryptoKeysGenerator startup
INFO: No encryption key found in configuration, generating key
Sep 07, 2016 3:54:29 AM oracle.dbtools.auth.crypto.CryptoKeysGenerator startup
INFO: No mac key found in configuration, generating key
Sep 07, 2016 3:54:29 AM oracle.dbtools.common.config.file.ConfigurationFilesBase update
INFO: Updated configurations: defaults
Sep 07, 2016 3:54:29 AM oracle.dbtools.auth.crypto.CryptoKeysGenerator startup
INFO: Updated configuration with generated keys
2016-09-07 03:54:29.793:INFO:/ords:main: INFO: Using configuration folder: /u01/oracle/ords.3.0.6/ordsi/ords
2016-09-07 03:54:29.793:INFO:/ords:main: FINEST: |ApplicationContext [configurationFolder=/u01/oracle/ords.3.0.6/ordsi/ords, services=Application Scope]|
Sep 07, 2016 3:54:29 AM oracle.dbtools.common.config.db.DatabasePools validatePool
INFO: Validating pool: |apex|pu|
Sep 07, 2016 3:54:29 AM oracle.dbtools.common.config.db.DatabasePools validatePool
INFO: Pool: |apex|pu| is correctly configured
config.dir
2016-09-07 03:54:30.298:INFO:/ords:main: INFO: Oracle REST Data Services initialized|Oracle REST Data Services version : 3.0.6.176.08.46|Oracle REST Data Services server info: jetty/9.2.z-SNAPSHOT|
2016-09-07 03:54:30.305:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@429bd883{/ords,null,AVAILABLE}
2016-09-07 03:54:30.346:INFO:oejs.ServerConnector:main: Started ServerConnector@b7f23d9{HTTP/1.1}{0.0.0.0:8090}
2016-09-07 03:54:30.348:INFO:oejs.Server:main: </pre>
<pre>Started @159913ms </pre>
<pre></pre>
<pre class="collapsible" data-initial-state="hidden" data-view-label="View Output"><code><b style="font-family: "Times New Roman"; white-space: normal;">4) Allow your schema to use ORDS </b></code></pre>
<pre class="collapsible" data-initial-state="hidden" data-view-label="View Output"><code>
</code></pre>
<pre class="collapsible" data-initial-state="hidden" data-view-label="View Output"><code>SQL> exec ords.enable_schema;
</code></pre>
<pre>SQL> COMMIT; </pre>
</div>
<div>
<br /></div>
<div>
<h4>
<span style="color: #707070; font-family: "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="background-color: white; font-size: 18px;">Define and Configure Your ORDS Service</span></span></h4>
</div>
<div>
<div>
Let's use the JavaScript procedure defined in an earlier blog post @</div>
<div>
</div>
http://db360.blogspot.in/2016/11/javascript-in-oracle-database-12c.html<br />
<br /></div>
<div>
<pre class="collapsible" data-initial-state="hidden" data-view-label="View Output"><code>Rem Create a procedure based on the select.js and it's javax.script wrapper (see the previous blog post)
CREATE OR REPLACE PROCEDURE selectproc(id IN varchar2)
IS
output varchar2(10000);
BEGIN
SELECT invokeScriptEval(id) INTO output from dual;
htp.prn(output);
END;
/
SHOW ERRORS;
-- delete load.routes module
begin
ords_services.delete_module(
p_name => 'load.routes');
commit;
end;
/
SHOW ERRORS;
-- External JS select query
-- URL: load/routes/nashorn/select
-- procedure: selectproc
begin
ords.create_service(
p_module_name => 'load.routes' ,
p_base_path => '/load/routes/',
p_pattern => 'nashorn/selectbyid/:id',
p_source_type => 'plsql/block',
p_source => 'begin selectproc(:id); end;'
);
commit;
end;
/
SHOW ERRORS; </code></pre>
<pre class="collapsible" data-initial-state="hidden" data-view-label="View Output"><code>
</code></pre>
<pre class="collapsible" data-initial-state="hidden" data-view-label="View Output"><code><b style="font-family: "Times New Roman"; white-space: normal;">Let's use the JavaScript procedure defined in an earlier blog post </b></code></pre>
<pre class="collapsible" data-initial-state="hidden" data-view-label="View Output"><code><div style="font-family: "Times New Roman"; white-space: normal;">
Open your web browser and navigate to <code>http://localhost:8090/ords/ordstest/load/routes/nashorn/selectbyid/100</code>.</div>
<div style="font-family: "Times New Roman"; white-space: normal;">
</div>
<div style="font-family: "Times New Roman"; white-space: normal;">
You must see the JSON document of the employee with <code>empid</code> as 100 displayed.</div>
<div style="font-family: "Times New Roman"; white-space: normal;">
</div>
<div style="font-family: "Times New Roman"; white-space: normal;">
That's it! You have just created your first ORDS service</div>
<div style="font-family: "Times New Roman"; white-space: normal;">
The same process can be used tor Java stored procedures or other JavaScript procedures in the database.</div>
<div style="font-family: "Times New Roman"; white-space: normal;">
</div>
<div style="font-family: "Times New Roman"; white-space: normal;">
</div>
<div style="font-family: "Times New Roman"; white-space: normal;">
<kbd>
</kbd></div>
</code></pre>
</div>
</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com2tag:blogger.com,1999:blog-25155671.post-42519363305649815532016-11-09T08:29:00.000-08:002017-05-26T15:28:51.836-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
</h2>
<h3 style="text-align: left;">
JavaScript in Oracle Database 12c Release 2</h3>
<div style="text-align: left;">
<span style="font-weight: normal;"><span style="font-size: small;">JSR 223 introduced the idea of Scripting for the Java platform. Java 8 furnishes the Nashorn JavaScript engine as a more performant replacement for Rhino </span></span></div>
<div>
Per the Redmonk ranking (http://redmonk.com/sogrady/2016/07/20/language-rankings-6-16/) and the TIOBE index (http://www.tiobe.com/tiobe-index), JavaScript is one the most popular programming languages, disputing the top seat with Java.</div>
<div>
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
</div>
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<div style="margin: 0px;">
This blog post is an update to <a href="http://db360.blogspot.in/2015/02/javascript-stored-procedures-and-nodejs.html?utm_source=dlvr.it&utm_medium=twitter&utm_campaign=Feed:+orana+%28OraNA%29">a previous post</a> which discussed the rationales and a proof of concept of Nashorn (JavaScript on the JVM) and Avatar.js (Node.js APIs on the JVM. This update discusses the real production implementation of Nashorn on the JVM in rhe database.</div>
</div>
<h3 style="text-align: left;">
Rationales for JavaScript in the Database</h3>
<br />
The embedded JVM in Oracle Database 12c Release 2 (a.k.a. OJVM) supports Java 8 and the Nashorn JavaScript engine.Running JavaScript in the database stemmed from the same motivations for running Java in the database namely: reuse of skills, libraries and code for implementing data-bound modules or applications and performance.<br />
<br />
However, JavaScript in the database makes sense only when it is processing data stored in the database thereby - and this is another major motivation -- yielding better performance by the virtue of running close to the data. The beauty of the Nashorn JavaScript engine on the JVM is the ability to call Java APIs from JavaScript e.g., calling JDBC APIs from JavaScript, for database access.<br />
<br />
Let's create an EMPLOEES table storing employees data as JSON documents<br />
<br />
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" id="268" name="OracleReview">CREATE TABLE employees (
</span><span class="segment" id="269" name="OracleReview"> id RAW(16) NOT NULL,
</span><span class="segment" id="270" name="OracleReview"> data CLOB,
</span><span class="segment" id="271" name="OracleReview"> CONSTRAINT employees_pk PRIMARY KEY (id),
</span><span class="segment" id="272" name="OracleReview"> CONSTRAINT employees_json_chk CHECK (data IS JSON)
</span><span class="segment" id="273" name="OracleReview">);
</span><span class="segment" id="274" name="OracleReview">
</span><span class="segment" id="275" name="OracleReview">INSERT INTO employees (id, data)
</span><span class="segment" id="276" name="OracleReview">VALUES (SYS_GUID(),
</span><span class="segment" id="277" name="OracleReview"> '{
</span><span class="segment" id="278" name="OracleReview"> "EmpId" : "100",
</span><span class="segment" id="279" name="OracleReview"> "FirstName" : "Kuassi",
</span><span class="segment" id="280" name="OracleReview"> "LastName" : "Mensah",
</span><span class="segment" id="281" name="OracleReview"> "Job" : "Manager",
</span><span class="segment" id="282" name="OracleReview"> "Email" : "kuassi@oracle.com",
</span><span class="segment" id="283" name="OracleReview"> "Address" : {
</span><span class="segment" id="284" name="OracleReview"> "City" : "Redwood",
</span><span class="segment" id="285" name="OracleReview"> "Country" : "US"
</span><span class="segment" id="286" name="OracleReview"> }
</span><span class="segment" id="287" name="OracleReview"> }');
</span><span class="segment" id="300" name="OracleReview">...</span></pre>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" name="OracleReview">...</span></pre>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" name="OracleReview">
</span><span class="segment" id="301" name="OracleReview">INSERT INTO employees (id, data)
</span><span class="segment" id="302" name="OracleReview">VALUES (SYS_GUID(),
</span><span class="segment" id="303" name="OracleReview"> '{
</span><span class="segment" id="304" name="OracleReview"> "EmpId" : "300",
</span><span class="segment" id="305" name="OracleReview"> "FirstName" : "Suresh",
</span><span class="segment" id="306" name="OracleReview"> "LastName" : "Mohan",
</span><span class="segment" id="307" name="OracleReview"> "Job" : "Developer",
</span><span class="segment" id="308" name="OracleReview"> "Email" : "Suresh@oracle.com",
</span><span class="segment" id="309" name="OracleReview"> "Address" : {
</span><span class="segment" id="310" name="OracleReview"> "City" : "Bangalore",
</span><span class="segment" id="311" name="OracleReview"> "Country" : "India"
</span><span class="segment" id="312" name="OracleReview"> }
</span><span class="segment" id="313" name="OracleReview"> }');
</span>COMMIT;</pre>
<br />
Here is a JavaScript code which uses JDBC for querying JSON documents stored in the EMPLOYEE table.<br />
<br />
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" id="367" name="OracleReview"><pre style="background-color: white; font-family: "Courier New"; font-size: 9pt;"><span style="color: navy; font-weight: bold;">var </span>selectQuery = <span style="color: navy; font-weight: bold;">function</span>(id)
{
<span style="color: navy; font-weight: bold;">var </span>Driver = Packages.oracle.jdbc.OracleDriver;
<span style="color: navy; font-weight: bold;">var </span>oracleDriver = <span style="color: navy; font-weight: bold;">new </span>Driver();
<span style="color: navy; font-weight: bold;">var </span>url = <span style="color: green; font-weight: bold;">"jdbc:default:connection:"</span>;
<span style="color: navy; font-weight: bold;">var </span>output = <span style="color: green; font-weight: bold;">""</span>;
<span style="color: navy; font-weight: bold;">var </span>connection = oracleDriver.defaultConnection();
<span style="color: navy; font-weight: bold;">var </span>prepStmt;
<span style="color: grey; font-style: italic;">// Prepare statement</span><span style="color: grey; font-style: italic;"> </span><span style="color: navy; font-weight: bold;">if</span>(id == <span style="color: green; font-weight: bold;">'all'</span>) {
prepStmt = connection.prepareStatement(<span style="color: green; font-weight: bold;">"SELECT a.data FROM employees a"</span>);
} <span style="color: navy; font-weight: bold;">else </span>{
prepStmt = connection.prepareStatement(<span style="color: green; font-weight: bold;">"SELECT a.data FROM employees a WHERE a.data.EmpId = ?"</span>);
prepStmt.setInt(<span style="color: blue;">1</span>, id);
}
<span style="color: grey; font-style: italic;">// execute Query</span><span style="color: grey; font-style: italic;"> </span><span style="color: navy; font-weight: bold;">var </span>resultSet = prepStmt.executeQuery();
<span style="color: grey; font-style: italic;">// display results</span><span style="color: grey; font-style: italic;"> </span><span style="color: navy; font-weight: bold;">while</span>(resultSet.next()) {
output = output + resultSet.getString(<span style="color: blue;">1</span>) + <span style="color: green; font-weight: bold;">"
"</span>;
}
<span style="color: grey; font-style: italic;">// cleanup</span><span style="color: grey; font-style: italic;"> </span>resultSet.close();
prepStmt.close();
connection.close();
<span style="color: navy; font-weight: bold;">return </span>output;
}</pre>
</span></pre>
<h3 style="text-align: left;">
Fluent JavaScript API using SODA for Java with Nashorn</h3>
<div>
For accessing JSON Collections and documents, Oracle furnishes SODA for Java; this API allows No SQL and dot notation access to JSON.<br /></div>
<div>
Check out the code samples and
scripts for running <a href="https://github.com/oracle/oracle-db-examples/blob/master/java/ojvm/SODA.md" moz-do-not-send="true">testSODA.java</a>
and <a href="https://github.com/oracle/oracle-db-examples/blob/master/javascript/nashorn/SODAjs.md" moz-do-not-send="true">testSODA.js</a>
in OJVM </div>
<h3 style="text-align: left;">
How to Run JavaScript in Oracle Database </h3>
<br />
<div style="text-align: left;">
Your schema (or database user) must be granted the DBJAVASCRIPT role (check with your DBA).</div>
Your JavaScript source code (select.js) may originate from strings, files or Java resources.<br />
<br />
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" id="78" name="OracleReview">function hello()
</span><span class="segment" id="79" name="OracleReview">{
</span><span class="segment" id="80" name="OracleReview">/*
</span><span class="segment" id="81" name="OracleReview">*This is a sample Javascript file that prints "Hello World".</span><span class="segment" id="82" name="OracleReview">
*/
</span><span class="segment" id="83" name="OracleReview">var hellow = "Hello World";
</span><span class="segment" id="84" name="OracleReview">return hellow;
</span><span class="segment" id="85" name="OracleReview">}
</span><span class="segment" id="86" name="OracleReview">var output = hello();
</span><span class="segment" id="87" name="OracleReview">print(output);</span></pre>
<br />
Oracle recommends loading your JavaScript source code from a file into the database, as Java resource, using the loadjava utility<br />
<br />
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" id="93" name="OracleReview">loadjava -v -u yourschema hello.js</span></pre>
<br />
Upon loading your JavaScrit code as a Java resource you may invoke it using: (i) either the dbms_java.javascript.run() procedure from SQL or PL/SQL, or (ii) DbmsJavaScript.run() Java call or the javax.script package.<br />
Make sure that your database schema has been granted the <code style="background-color: white; color: #222222; font-size: 11.6188px;"><span class="segment" id="142" name="OracleReview">DBJAVASCRIPT</span></code><span class="segment" id="143" name="OracleReview" style="background: rgb(255 , 255 , 153); color: #222222; font-family: "tahoma" , sans-serif; font-size: x-small;"> </span><span class="segment" name="OracleReview" style="background-color: white; color: #222222; font-family: "tahoma" , sans-serif; font-size: x-small;">role.</span><br />
<br />
<h4 style="text-align: left;">
Running JavaScript in the Database using DBMS_JAVA.JAVASCRIPT.RUN Procedure</h4>
From SQL or PL/SQL<br />
<span style="background-color: #eeeeee; font-size: 11.6188px;"><br /></span>
<br />
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" id="121" name="OracleReview">SQL>set serveroutput on
</span><span class="segment" id="122" name="OracleReview">SQL>call dbms_java.set_output(20000);
</span><span class="segment" id="123" name="OracleReview">SQL>call dbms_javascript.run("hello.js");</span><span style="background-color: transparent;"> </span></pre>
<h4 style="text-align: left;">
Running JavaScript in the Database using DbmsJavaScript.run Java call</h4>
From Java running in the database<br />
<br />
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" id="144" name="OracleReview">import oracle.aurora.rdbms.DbmsJavaScript;
</span><span class="segment" id="145" name="OracleReview">…
</span><span class="segment" id="146" name="OracleReview">DbmsJavaScript.run("hello.js");</span></pre>
<h4 style="text-align: left;">
Notes: </h4>
<ul style="background-color: white; color: #222222; font-family: Tahoma, sans-serif; font-size: small;">
<li><div style="max-width: 70em;">
<span class="segment" id="66" name="OracleReview">The direct invocation of Nashorn classes is restricted in Oracle JVM.</span></div>
</li>
<li><div style="max-width: 70em;">
<span class="segment" id="67" name="OracleReview">All scripting mode extensions are disabled in Oracle JVM.</span></div>
</li>
</ul>
<h4 style="text-align: left;">
Running JavaScript in the Database using the javax.script API</h4>
<div>
Invoking JavaScript in the database using the javax.script API requires the following steps:</div>
<ol style="background-color: white; color: #222222; font-family: Tahoma, sans-serif; font-size: small;">
<li><div style="max-width: 70em;">
<span class="segment" id="159" name="OracleReview">Instantiate a script manager</span></div>
</li>
<li><div style="max-width: 70em;">
<span class="segment" id="160" name="OracleReview">Create an engine</span></div>
</li>
<li><div style="max-width: 70em;">
<span class="segment" id="161" name="OracleReview">Pass your resource stream reader as the argument to the </span><code style="font-size: 11.6188px;">eval</code><span class="segment" id="163" name="OracleReview"> method of the engine</span></div>
</li>
</ol>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" id="169" name="OracleReview">import javax.script.*;
</span><span class="segment" id="170" name="OracleReview">import java.net.*;
</span><span class="segment" id="171" name="OracleReview">import java.io.*;
</span><span class="segment" id="172" name="OracleReview">...</span>
<span class="segment" id="173" name="OracleReview">// create a script engine manager
</span><span class="segment" id="174" name="OracleReview">ScriptEngineManager factory = new ScriptEngineManager();
</span><span class="segment" id="175" name="OracleReview">// create a JavaScript engine
</span><span class="segment" id="176" name="OracleReview">ScriptEngine engine =
</span><span class="segment" id="177" name="OracleReview"> factory.getEngineByName("javascript");
</span><span class="segment" id="178" name="OracleReview">// create schema resource URL
</span><span class="segment" id="179" name="OracleReview">URL url = Thread.currentThread()
</span><span class="segment" id="180" name="OracleReview"> .getContextClassLoader().getResource("hello.js");
</span><span class="segment" id="181" name="OracleReview">engine.eval(new InputStreamReader(url.openStream()));
</span><span class="segment" id="182" name="OracleReview">...</span></pre>
<br />
These steps can be turned into a wrapper class (the signature may differ depending on your input parameters and return value(s).<br />
<br />
Here is a javax.script wrapper for invoking select.js JavaScript function (shown earlier).<br />
<div class="line number1 index0 alt2" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #666666; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="js plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #666666; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<pre class="oac_no_warn" dir="ltr" style="border-radius: 4px; color: black; font-size: 11.6188px; padding: 0.5ex 1ex;"></pre>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; color: black; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" name="OracleReview">create or replace and compile java resource named "InvokeScript" as</span></pre>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; color: black; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" name="OracleReview">import javax.script.*;
</span><span class="segment" id="373" name="OracleReview">import java.net.*;
</span><span class="segment" id="374" name="OracleReview">import java.io.*;
</span></pre>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; color: black; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" id="376" name="OracleReview"><span style="font-family: "consolas" , "bitstream vera sans mono" , "courier new" , "courier" , monospace; font-size: 11.6188px;">public class InvokeScript {</span> </span></pre>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; color: black; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" name="OracleReview">public static String eval(String inputId) throws Exception {
</span><span class="segment" id="377" name="OracleReview"> String output = new String();
</span><span class="segment" id="378" name="OracleReview"> try {
</span><span class="segment" id="379" name="OracleReview"> // create a script engine manager
</span><span class="segment" id="380" name="OracleReview"> ScriptEngineManager factory = new ScriptEngineManager();
</span><span class="segment" id="381" name="OracleReview"> // create a JavaScript engine
</span><span class="segment" id="382" name="OracleReview"> ScriptEngine engine = factory.getEngineByName("javascript");
</span><span class="segment" id="383" name="OracleReview"> //read the script as a java resource
</span><span class="segment" id="384" name="OracleReview"> engine.eval(new InputStreamReader(InvokeScript.class.getResourceAsStream("select.js")));
</span><span class="segment" id="385" name="OracleReview"> // Alternative approach
</span><span class="segment" id="386" name="OracleReview"> //engine.eval(Thread.currentThread().getContextClassLoader().getResource("select.js"));
</span><span class="segment" id="387" name="OracleReview"> Invocable invocable = (Invocable) engine;
</span><span class="segment" id="388" name="OracleReview"> Object selectResult = invocable.invokeFunction("selectQuery", inputId);
</span><span class="segment" id="389" name="OracleReview"> output = selectResult.toString();
</span><span class="segment" id="390" name="OracleReview"> } catch(Exception e) {
</span><span class="segment" id="391" name="OracleReview"> output =e.getMessage();
</span><span class="segment" id="392" name="OracleReview"> }
</span><span class="segment" id="393" name="OracleReview"> return output;
</span><span class="segment" id="394" name="OracleReview"> }
</span><span class="segment" id="395" name="OracleReview">}
</span><span class="segment" id="396" name="OracleReview">/</span></pre>
</div>
</div>
<div class="line number4 index3 alt1" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #666666; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="js plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code></div>
<div class="line number4 index3 alt1" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<span style="font-family: "times new roman"; font-size: small; white-space: normal;">Then we need to create a SQL wrapper for the eval function</span></div>
<div class="line number4 index3 alt1" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<span style="font-family: "times new roman"; font-size: small; white-space: normal;"><br /></span></div>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" currnote="" id="400" name="OracleReview">-- Create function
</span><span class="segment" id="401" name="OracleReview">CREATE OR REPLACE FUNCTION invokeScriptEval(inputId varchar2) return varchar2 as language java
</span><span class="segment" id="402" name="OracleReview">name 'InvokeScript.eval(java.lang.String) </span></pre>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" name="OracleReview"> return java.lang.String'; </span></pre>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" name="OracleReview">/</span></pre>
<div class="line number4 index3 alt1" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<span style="font-family: "times new roman"; font-size: small; white-space: normal;"><br /></span></div>
<div class="line number4 index3 alt1" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<span style="font-family: "times new roman"; font-size: small; white-space: normal;">Allow and make easy to call invokeScriptEval() from SQL or PL/SQL </span></div>
<div class="line number4 index3 alt1" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<span style="font-family: "times new roman"; font-size: small; white-space: normal;"><br /></span></div>
<div class="line number4 index3 alt1" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" id="407" name="OracleReview">CREATE OR REPLACE PROCEDURE sqldemo(id IN varchar2)
</span><span class="segment" id="408" name="OracleReview">IS
</span><span class="segment" id="409" name="OracleReview"> output varchar2(10000);
</span><span class="segment" id="410" name="OracleReview">BEGIN
</span><span class="segment" id="411" name="OracleReview"> SELECT invokeScriptEval(id) INTO output from dual;
</span><span class="segment" id="412" name="OracleReview"> dbms_output.put_line(output);
</span><span class="segment" id="413" name="OracleReview">END;
</span><span class="segment" id="414" name="OracleReview">/
</span><span class="segment" id="415" name="OracleReview">SHOW ERRORS;</span></pre>
</div>
<div class="line number4 index3 alt1" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<span style="font-family: "times new roman"; font-size: small; white-space: normal;"> </span></div>
<div style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; width: auto !important;">
Finally, invoke SelectQuery function (in select.js), using Javax API thru SQLDEMO procedure</div>
<div style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<br /></div>
<pre class="oac_no_warn" dir="ltr" style="background-color: #eeeeee; border-radius: 4px; font-size: 11.6188px; padding: 0.5ex 1ex;"><span class="segment" id="419" name="OracleReview">In a SQLPlus session
set serveroutput on
</span><span class="segment" id="420" name="OracleReview">call dbms_java.set_output(5000);
</span><span class="segment" id="421" name="OracleReview">call sqldemo('100');</span></pre>
<div style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<br /></div>
<h3 style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; width: auto !important;">
</h3>
<h3 style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; width: auto !important;">
REST Enabling JavaScript in the Database</h3>
<div style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<br /></div>
<div style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; width: auto !important;">
You may turn your JavaScript function into a REST service deployed in Oracle Cloud by wrapping it with the Oracle Rest Data Service (ORDS). See <a href="http://db360.blogspot.in/2016/11/rest-enable-java-or-javascript-in.html">the related blog post</a> and <a href="http://bit.ly/2fmrcWI">the Java Developers guide </a>in the Oracle Database 12c Release 2 doc library for more details.</div>
<div style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<br /></div>
<div style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<br /></div>
<div style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<br /></div>
<div class="line number4 index3 alt1" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<br /></div>
<div class="line number4 index3 alt1" style="background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #666666; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 13.2px; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="js plain" style="background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><br /></code></div>
</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com2tag:blogger.com,1999:blog-25155671.post-90927291238781293662016-08-17T11:39:00.002-07:002016-08-24T10:35:55.193-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
JavaOne and OOW 2016: Sessions Recommendations<br /><div style="text-align: left;">
<span style="font-weight: normal;"><span style="font-size: x-small;"><br /></span></span></div>
<div style="text-align: left;">
<span style="font-weight: normal;"><span style="font-size: x-small;">If you are attending JavaOne and/or Oracle OpenWorld, here are my sessions recommendations.</span></span><br />
<br /></div>
</h3>
<h4 style="text-align: left;">
1) JavaOne </h4>
<div style="text-align: left;">
</div>
<ul style="text-align: left;">
<li><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$0.0.1.1.0.1" style="box-sizing: border-box; font-size: x-small; list-style: none; margin: 0px; padding: 0px;"> </span><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><a href="https://oracle.rainfocus.com/scripts/catalog/oow16.jsp?search=CON2843&search.event=javaone">How Multidimensional Search Trees Speed Up a Java Connection Pool [CON2843]</a><br /><span style="color: #515151; line-height: 25.6px;"><span style="font-size: x-small;"><b>Tuesday, Sep 20, 5:30 p.m. - 6:30 p.m. | Parc 55 - Cyril Magnin II/III</b></span></span></span></li>
</ul>
<ul style="text-align: left;">
<li><span style="background-color: white; cursor: pointer; line-height: 30px;"><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="box-sizing: border-box; color: #23527c; font-family: "arial" , "helvetica" , sans-serif; list-style: none; margin: 0px; padding: 0px;"></span></span><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$1.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><a href="https://oracle.rainfocus.com/scripts/catalog/oow16.jsp?search=CON1578&search.event=javaone">JDBC Next: A New Nonblocking API for Connecting to a Database [CON1578]</a><br /><span style="color: #515151; line-height: 25.6px;"><span style="font-size: x-small;"><b>Monday, Sep 19, 12:30 p.m. - 1:30 p.m. | Hilton - Continental Ballroom 1/2/3</b></span></span></span></li>
</ul>
<ul style="text-align: left;">
<li><span style="background-color: white; cursor: pointer; line-height: 30px;"><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="box-sizing: border-box; color: #23527c; font-family: "arial" , "helvetica" , sans-serif; list-style: none; margin: 0px; padding: 0px;"></span></span><span style="cursor: pointer;"><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$1.0.1.1.0.2" style="box-sizing: border-box; color: #337ab7; list-style: none; margin: 0px; padding: 0px;"></span></span><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$6.0.1.1.0.1" style="box-sizing: border-box; cursor: pointer; display: inline; list-style: none; margin: 0px; padding: 0px;"><a href="https://oracle.rainfocus.com/scripts/catalog/oow16.jsp?search=BOF1566&search.event=javaone"> </a></span><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$6.0.1.1.0.2" style="box-sizing: border-box; cursor: pointer; display: inline; list-style: none; margin: 0px; padding: 0px;"><a href="https://oracle.rainfocus.com/scripts/catalog/oow16.jsp?search=BOF1566&search.event=javaone">Scalability and HA with Java EE Containers, JDBC, and Java Connection Pool [BOF1566]</a><br /><span style="color: #515151; line-height: 25.6px;"><span style="font-size: x-small;"><b>Tuesday, Sep 20, 8:00 p.m. - 8:45 p.m. | Parc 55 - Cyril Magnin II/III</b></span></span></span></li>
</ul>
<h4 style="text-align: left;">
2) Oracle OpenWorld </h4>
<div style="text-align: left;">
</div>
<ul style="text-align: left;">
<li><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$2.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><a href="https://oracle.rainfocus.com/scripts/catalog/oow16.jsp?search=CON6454&search.event=oracleopenworld">Oracle Database 12<i style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;">c</i> Release 2 JDBC and UCP Features and Best Practices [CON6454]</a><br /><span style="color: #515151; line-height: 25.6px;"><span style="font-size: x-small;"><b>Tuesday, Sep 20, 12:15 p.m. - 1:00 p.m. | Park Central - Olympic</b></span></span></span></li>
<li><span style="background-color: white; cursor: pointer; line-height: 30px;"><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$2.0.1.1.0.2" style="box-sizing: border-box; color: #337ab7; font-family: "arial" , "helvetica" , sans-serif; list-style: none; margin: 0px; padding: 0px;"></span></span><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$3.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><a href="https://oracle.rainfocus.com/scripts/catalog/oow16.jsp?search=CON6358&search.event=oracleopenworld">A RESTful Microservice for JSON in Oracle Database 12<i style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;">c</i> Release 2 [CON6358]</a><br /><span style="color: #515151; line-height: 25.6px;"><span style="font-size: x-small;"><b>Thursday, Sep 22, 9:30 a.m. - 10:15 a.m. | Park Central - Olympic</b></span></span></span></li>
<li><span style="background-color: white; cursor: pointer; line-height: 30px;"><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$2.0.1.1.0.2" style="box-sizing: border-box; color: #337ab7; font-family: "arial" , "helvetica" , sans-serif; list-style: none; margin: 0px; padding: 0px;"></span></span><span style="cursor: pointer;"><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$3.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"></span></span><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$4.0.1.1.0.1" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><a href="https://oracle.rainfocus.com/scripts/catalog/oow16.jsp?search=CON6359&search.event=oracleopenworld"> </a></span><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$4.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><a href="https://oracle.rainfocus.com/scripts/catalog/oow16.jsp?search=CON6359&search.event=oracleopenworld">Querying Oracle Table from Hadoop/Hive and Querying Hadoop/HDFS from PL/SQL [CON6359]</a><br /><span style="color: #515151; line-height: 25.6px;"><span style="font-size: x-small;"><b>Monday, Sep 19, 4:15 p.m. - 5:00 p.m. | Park Central - Metropolitan II</b></span></span></span></li>
<li><span data-reactid=".0.0.0.1.0.2.0.0.0.0.0.1:$0.2.$5.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><a href="https://oracle.rainfocus.com/scripts/catalog/oow16.jsp?search=MTE7183&search.event=oracleopenworld">Meet the Developers and get Your Questions Answered [MTE7183]</a><br /><span style="color: #515151; line-height: 25.6px;"><span style="font-size: x-small;"><b>Tuesday, Sep 20, 7:15 p.m. - 8:00 p.m. | Moscone South - 310</b></span></span></span></li>
</ul>
<br />
<b>3) Must-See Guide for Data Warehousing and Big Data </b><br />
<br />
<br />
<li>
<div id="article_body">
PDF version can be downloaded by
<strong><a href="https://googledrive.com/host/0B40aDGvPy4WbSW5sN1dTbV9YalU/DW-Must-See-Guide-OpenWorld%202016.pdf">clicking here</a></strong></div>
</li>
<li><div id="article_body">
Apple iBooks version can be
downloaded by <strong><a href="https://itunes.apple.com/us/book/id1142283153" target="_blank">clicking here</a></strong></div>
</li>
</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com1tag:blogger.com,1999:blog-25155671.post-23864799814645490272015-09-27T12:52:00.000-07:002015-10-19T10:49:21.571-07:00My sessions recommendations for JavaOne '15 and OOW '15 <div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="color: red; font-size: large;">JavaOne SF 2015 Session recommendations</span></b><br />
<br />
<div style="text-align: left;">
<span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$1.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="font-size: large;">High Availability with Java EE Containers, JDBC, and Java Connection Pools [BOF7732]</span><br /><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;">Monday, Oct 26, 8:00 p.m. | Parc 55—Mission</span></span></div>
<div style="text-align: left;">
<a class="rf-action" data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$1.0.1.1.0" href="https://www.blogger.com/null" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; cursor: pointer; display: inline; list-style: none; margin: 0px; padding: 0px;"><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;"><br /></span></a></div>
<div style="text-align: left;">
<span style="font-size: large;">Implement Cloud Data Services with Java 8 Nashorn <a href="https://oracleus.lanyonevents.com/2015/content/sessionDetail.do?SESSION_ID=4405"><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;">[CON4405]</span></a></span></div>
<div style="text-align: left;">
<a class="rf-action" data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0" href="https://www.blogger.com/null" style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #337ab7; cursor: pointer; display: inline; font-family: Arial, Helvetica, sans-serif; font-size: 20px; line-height: 30px; list-style: none; margin: 0px; padding: 0px;"><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;">Tuesday, Oct 27, 4:00 p.m. | Hilton—Continental Ballroom 1/2/3</span></span></a></div>
<br />
<span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$2.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="font-size: large;"><a href="https://oracleus.lanyonevents.com/2015/content/sessionDetail.do?SESSION_ID=2158">Java Connection Pool Performance and Scalability with Wait-Free Programming [CON2158]</a></span><br /><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;">Wednesday, Oct 28, 4:30 p.m. | Hilton—Continental Ballroom 1/2/3</span></span><br />
<a class="rf-action" data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$2.0.1.1.0" href="https://www.blogger.com/null" style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #337ab7; cursor: pointer; display: inline; font-family: Arial, Helvetica, sans-serif; font-size: 20px; line-height: 30px; list-style: none; margin: 0px; padding: 0px;"><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$2.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;"><br /></span></span></a>
<b><span style="color: red; font-size: large;">OOW SF 2015 - Session recommendations</span></b><br />
<b><br /></b>
<span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="font-size: large;">Java Virtual Machine Cookbook [UGF2720]</span><br /><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;">Sunday, Oct 25, 9:00 a.m. | Moscone West—3011</span></span><br />
<span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;"><br /></span></span>
<span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"></span><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$1.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="font-size: large;"><a href="https://oracleus.lanyonevents.com/2015/content/sessionDetail.do?SESSION_ID=8461">Next-Generation Database: </a></span></span><span style="font-size: large;">Implement Cloud Data Services with Java 8 Nashorn</span><a href="https://oracleus.lanyonevents.com/2015/content/sessionDetail.do?SESSION_ID=8461" style="font-size: x-large;"> [CON8461]</a><br />
<span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$1.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;">Monday, Oct 26, 5:15 p.m. | Moscone South—308</span></span><br />
<a class="rf-action" data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0" href="https://www.blogger.com/null" style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #23527c; cursor: pointer; display: inline; font-family: Arial, Helvetica, sans-serif; font-size: 20px; line-height: 30px; list-style: none; margin: 0px; outline: 0px; padding: 0px;"><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"></span></a><a class="rf-action" data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$1.0.1.1.0" href="https://www.blogger.com/null" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; color: #337ab7; cursor: pointer; display: inline; list-style: none; margin: 0px; padding: 0px;"><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$1.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;"><br /></span></span></a>
<span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"></span><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$1.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"></span><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$3.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="font-size: large;"><a href="https://oracleus.lanyonevents.com/2015/content/sessionDetail.do?SESSION_ID=8460">Next-Generation Database: Java Connection Pool for Multitenant and Sharded Databases [CON8460]</a></span><br /><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;">Monday, Oct 26, 2:45 p.m. | Moscone South—308</span></span><br />
<br />
<a href="https://oracleus.lanyonevents.com/2015/content/sessionDetail.do?SESSION_ID=8459" style="font-size: x-large;">Integrate Master Data with Big Data on Hadoop and Spark [CON8459]</a><br />
<span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$2.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;">Wednesday, Oct 28, 3:00 p.m. | Moscone South—308</span></span><br />
<span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$2.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;"><br /></span></span>
<span style="font-size: large;"><a href="https://oracleus.lanyonevents.com/2015/content/sessionDetail.do?SESSION_ID=8462"><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"></span><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;">Market Basket Analysis Using Oracle In-Database Container for Hadoop [CON8462]</span></a></span><br />
<span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;">Thursday, Oct 29, 12:00 p.m. | Moscone South—307</span><br />
<a class="rf-action" data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0" href="https://www.blogger.com/null" style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #23527c; cursor: pointer; display: inline; font-family: Arial, Helvetica, sans-serif; font-size: 20px; line-height: 30px; list-style: none; margin: 0px; outline: 0px; padding: 0px;"><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;"><br /></span></span></a>
<span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"></span><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="font-size: large;"><a href="https://oracleus.lanyonevents.com/2015/content/sessionDetail.do?SESSION_ID=10310">Next-Gen Database Enhancements for Java Application Performance and Scalability [CON10310]</a></span><br /><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;">Thursday, Oct 29, 2:30 p.m. | Moscone South—307</span></span><br />
<a class="rf-action" data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0" href="https://www.blogger.com/null" style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #23527c; cursor: pointer; display: inline; font-family: Arial, Helvetica, sans-serif; font-size: 20px; line-height: 30px; list-style: none; margin: 0px; outline: 0px; padding: 0px;"><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;"><br /></span></span></a>
<a class="rf-action" data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0" href="https://www.blogger.com/null" style="-webkit-font-smoothing: antialiased; background-color: white; box-sizing: border-box; color: #23527c; cursor: pointer; display: inline; font-family: Arial, Helvetica, sans-serif; font-size: 20px; line-height: 30px; list-style: none; margin: 0px; outline: 0px; padding: 0px;"><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$0.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"></span></a><span data-reactid=".0.0.0.1.0.0.0.0.0.1:$0.2.$4.0.1.1.0.2" style="-webkit-font-smoothing: antialiased; box-sizing: border-box; list-style: none; margin: 0px; padding: 0px;"><span style="font-size: large;">Dialog with the Oracle Database Java Developers and Architects [MTE9501]</span><br /><span style="color: #515151; font-size: 16px; line-height: 25.6000003814697px;">Tuesday, Oct 27, 7:15 p.m. | Moscone South—305</span></span><br />
<br />
<br /></div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com3tag:blogger.com,1999:blog-25155671.post-31649189771357310972015-09-08T15:37:00.000-07:002015-09-08T15:37:05.218-07:00 JavaScript stored procedures as Cloud data services.<div dir="ltr" style="text-align: left;" trbidi="on">
Find out how to implement JavaScript Stored Procedures with Oracle Database 12c and how to invoke these through RESTful Web Services.<br />
<br />
https://blogs.oracle.com/java/entry/nashorn_and_stored_procedures</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com1tag:blogger.com,1999:blog-25155671.post-29206723535944028502015-02-09T18:44:00.004-08:002017-04-05T16:10:28.589-07:00JavaScript Stored Procedures and Node.js Applications with Oracle Database 12c <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="OTitle">
<span style="font-size: large;"><a href="https://www.blogger.com/null" name="OLE_LINK2"></a><a href="https://www.blogger.com/null" name="OLE_LINK1"><b><span style="font-family: "times new roman" , serif;">JavaScript Stored
Procedures and Node.js Applications with Oracle Database 12c <o:p></o:p></span></b></a></span></div>
<div class="MsoNormal">
<b><span lang="EN-GB"><span style="font-size: large;"> </span>Kuassi Mensah<span style="font-size: 11pt;"><o:p></o:p></span></span></b></div>
<div class="MsoNormal">
<span lang="FR" style="font-size: 11.0pt; mso-ansi-language: FR;"> db360.blogspot.com | @kmensah | https://www.linkedin.com/in/kmensah <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 11pt;"><br /></span></div>
<div class="MsoNormal">
<b>Keywords</b>:
<a href="https://www.blogger.com/null" name="OLE_LINK4"></a><a href="https://www.blogger.com/null" name="OLE_LINK3">JavaScript,
Node.js, Java, JVM, Nashorn, Avatar.js</a></div>
<h1>
<span lang="EN-GB"><span style="font-size: large;">Introduction</span></span><span style="font-size: 11pt;"> </span></h1>
<div class="OIntro">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Node.js
and server-side JavaScript are hot and trendy; per the latest “<i>RedMonk Programming Languages Rankings</i>”<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn1" name="_ftnref1" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: #4c4c4c; font-size: 11pt;">[1]</span></span><!--[endif]--></span></a>,
JavaScript and Java are the top two programming languages. For most developers
building modern Web, mobile, and cloud based applications, the ability to use
the same language across all tiers (client, middle, and database) feels like
Nirvana but the IT landscape is not a green field; enterprises have invested a
lot in Java (or other platforms for that matter) therefore, the integration of JavaScript
with it becomes imperative. WebSockets and RESTful services enable loose integration
however, the advent of JavaScript engines on the JVM (Rhino, Nashorn, DynJS),
and Node.js APIs on the JVM (Avatar.js, Nodyn, Trireme), make possible and very
tempting to co-locate Java and Node applications on the same JVM. <br />
This paper describes the steps for running JavaScript stored procedures<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn2" name="_ftnref2" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: #4c4c4c; font-size: 11pt;">[2]</span></span><!--[endif]--></span></a>
directly on the embedded JVM in Oracle database 12c and the steps for running Node.js
applications on the JVM against Orace database 12c, using Avatar.js, JDBC and
UCP.</span><span lang="EN-GB" style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"> <br />
<!--[endif]--><o:p></o:p></span></div>
<h1>
<span style="font-size: large;"><span lang="DE">JavaScript and the
Evolution of Web Applications Architecture</span><span lang="EN-GB"> </span></span><span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB;"> </span></h1>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">At
the beginning, once upon a time, long time ago, JavaScript was a browser-only
thing while business logic, back-end services and even presentations where handled/produced
in middle-tiers using Java or other platforms and frameworks. Then JavaScript
engines (Google’s V8, Rhino) leave the browsers and gave birth to server-side
JavaScript frameworks and Node.js.<o:p></o:p></span></div>
<h2>
<span lang="DE" style="font-size: 10.0pt;">Node Programming Model<o:p></o:p></span></h2>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Node.js
and similar frameworks bring ease of development rapid prototyping,
event-driven, and non-blocking programming model<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn3" name="_ftnref3" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[3]</span></span><!--[endif]--></span></a>
to JavaScript. This model is praised for its scalability and good enough performance
however, unlike Java, Node lacks standardization in many areas such as database
access i.e., JDBC equivalent, and may lead, without discipline, to the so
called “callback hell<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn4" name="_ftnref4" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[4]</span></span><!--[endif]--></span></a>”.<br />
Nonetheless, Node is popular and has a vibrant community and a large set of frameworks<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn5" name="_ftnref5" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[5]</span></span><!--[endif]--></span></a>.<o:p></o:p></span></div>
<h2>
<span lang="DE" style="font-size: 10.0pt;">Node Impact on Web Applications
Architecture<o:p></o:p></span></h2>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">With
the advent of Node, REST and Web Sockets, the architecture of Web applications
has evolved into </span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">(i) plain JavaScript on browsers (mobiles, tablets, and
desktops); </span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">(ii) server-side JavaScript modules (i.e., Node.js, ORM frameworks)
interacting with Java business logic and databases.<o:p></o:p></span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , serif; font-size: 11pt;">The
new proposal for Web applications architecture is the integration of Node.js and
Java on the JVM. </span><span style="font-family: "times new roman" , serif; font-size: 11pt;"> </span><span style="font-family: "times new roman" , serif; font-size: 11pt;">Let’s discuss the enabling
technologies: JavaScript engine on the JVM and Node API on the JVM and describe
typical use cases with Oracle database 12</span><i style="font-family: 'Times New Roman', serif; font-size: 11pt;">c</i><span style="font-family: "times new roman" , serif; font-size: 11pt;">.
</span><span style="font-family: "times new roman" , serif; font-size: 11pt;"> </span></div>
<h1>
<span lang="DE"><span style="font-size: large;">JavaScript on the JVM</span></span></h1>
<div style="text-align: left;">
<span lang="EN-GB" style="font-size: 11.0pt; font-weight: normal; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">Why implement a JavaScript engine
and run JavaScript on the JVM? For starters, i highly recommend Mark Swartz ‘s <a href="http://moduscreate.com/javascript-and-the-jvm/">http://moduscreate.com/javascript-and-the-jvm/</a>
and Steve Yegge’s <a href="http://steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.html">http://steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.html</a>
blog posts.</span><span style="font-size: 11pt; font-weight: normal;"> </span></div>
<h2>
<span lang="EN-GB" style="font-size: 11.0pt; font-weight: normal; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;"><span style="font-size: 11pt;"><span style="font-weight: normal;">In summary, the JVM brings</span> </span></span><span style="font-size: 11pt; font-weight: normal;">(i) portability; </span><span style="font-size: 11pt; font-weight: normal;">(ii) manageability; </span><span style="font-size: 11pt; font-weight: normal;">(iii) Java tools; </span><span style="font-size: 11pt; font-weight: normal;">(iv) Java libraries/technologies such as JDBC, Hadoop; </span><span style="font-size: 11pt; font-weight: normal;">and (v) the
preservation of investments in Java. </span><span style="font-size: 11pt; font-weight: normal;"><br /></span></h2>
<h2>
<span style="font-size: 11pt; font-weight: normal;">There are several implementations/projects
of Java based JavaScript engines including Rhino, DynJS and Nashorn.</span></h2>
<h2>
<span lang="EN-GB" style="font-size: small; mso-ansi-language: EN-GB; mso-bidi-font-size: 11.0pt;">Rhino</span><span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB;"><br />
</span><div style="text-align: left;">
<span style="font-weight: normal;"><span style="font-size: small;"><span class="OBodyTextChar"><span lang="DE" style="font-family: "times new roman" , "serif"; font-size: 11.0pt; font-weight: normal;">First</span></span><span class="OBodyTextChar"><span lang="DE" style="font-size: 11.0pt; font-weight: normal; mso-bidi-font-weight: bold;"> JavaScript engine entirely written in Java; started at NetScape in 1997 then, became an
open-source Mozilla project</span></span><a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn6" name="_ftnref6" title=""><span class="MsoFootnoteReference"><span lang="DE" style="color: black; font-size: 11.0pt; font-weight: normal; letter-spacing: -0.05pt;"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span lang="DE" style="font-family: "times new roman" , serif; letter-spacing: -0.05pt;">[6]</span></span><!--[endif]--></span></span></a><span class="OBodyTextChar"><span lang="DE" style="font-size: 11.0pt; font-weight: normal; mso-bidi-font-weight: bold;">. Was for quite some time the default JavaScript
engine in Java SE, now replaced by
Nashorn in Java SE 8.</span></span> </span></span></div>
</h2>
<h2>
<span lang="EN-GB"><span style="font-size: 10pt;">DynJS</span><span style="font-size: 13.3333330154419px;"><br /></span></span><span style="font-size: 11pt; font-weight: normal;">DynJS is another open-source JavaScript
engine for the JVM. Here is the project homepage http://dynjs.org/.</span><span style="font-size: 11pt;"> </span></h2>
<div class="OBodyText">
<b><span style="font-family: "times new roman" , "serif"; font-size: 10.0pt;">Nashorn</span></b><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"><br />
Introduced in Java 7 but “production” in Java 8<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn7" name="_ftnref7" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[7]</span></span><!--[endif]--></span></a>,
the goal of project Nashorn (JEP 174), is to enhance the performance and
security of the Rhino JavaScript engine on the JVM. It integrates with <i>javax.script</i> API (JSR 223) and allows
seamless interaction between Java and JavaScript (i.e., invoking Nashorn from
Java and invoking Java from Nashorn).<br /><br />
</span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">To illustrate the reach of Nashorn on the JVM and the interaction between Java
and JavaScript, let’s run some JavaScript directly on the database-embedded JVM
in Oracle database 12c.</span><span style="font-size: 11pt;"> </span></div>
<h1>
<span lang="DE"><span style="font-size: large;">JavaScript Stored Procedures
with Oracle database 12c Using Nashorn</span><br />
<!--[endif]--></span><span lang="DE" style="font-size: 11.0pt;"><o:p></o:p></span></h1>
<div style="text-align: left;">
<span style="font-size: large;"><a href="http://db360.blogspot.com/2016/11/javascript-in-oracle-database-12c.html">See the Updated version</a> </span></div>
<div style="text-align: left;">
<span style="font-size: large;"><br /></span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Why
would anyone run JavaScript in the database? For the same reasons you’d run
Java in Oracle database. Then you might ask: why run Java in the database, in
the first place? As discussed in my book<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn8" name="_ftnref8" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[8]</span></span><!--[endif]--></span></a>,
the primary motivations are: </span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">(i) reuse skills and code, i.e., which programming
languages are your new hire knowledgeable of or willing to learn; </span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">(ii) avoid
data shipping<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn9" name="_ftnref9" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[9]</span></span><!--[endif]--></span></a> i.e.,
in-place processing of billions of data/documents; </span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">(iii) combine SQL with foreign
libraries to achieve new database capability thereby extending SQL and the reach
of the RDBMS, e.g., Web Services callout, in-database container for Hadoop<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn10" name="_ftnref10" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[10]</span></span><!--[endif]--></span></a>. </span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Some developers/architects prefer a tight separation between the RDBMS and
applications therefore, no programming language in the database<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn11" name="_ftnref11" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[11]</span></span><!--[endif]--></span></a>but
there are many pragmatic developers/architects who run code near data, whenever
it is more efficient than shipping data to external infrastructure. <o:p></o:p></span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"><br /></span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Co-locating
functions with data on the same compute engine is shared by many programming
models such as Hadoop. With the surge and prevalence of Cloud computing, RESTful
service based architecture is the new norm. Data-bound services can be secured
and protected by the REST infrastructure, running outside the RDBMS. Typical
use case: a JavaScript stored
procedures service would process millions/billions of JSON documents in the Oracle database and would return the result sets to the service invoker.</span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"><br />
To conclude, running Java, JRuby, Python, JavaScript, Scala, or other
programming language on the JVM in the database is a sound architectural choice.
The best practices consist in: (i) partitioning applications into data-bound
and compute-bound modules or services; (ii) data-bound services are good
candidates for running in the database; (iii) understand Oracle database </span><span style="font-family: "courier new"; font-size: 11.0pt;">DEFINER</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"> </span><span style="font-family: "courier new"; font-size: 11.0pt;">INVOKER</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"> rights <a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn12" name="_ftnref12" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[12]</span></span><!--[endif]--></span></a>
and grant only the necessary privilege(s) and/or permission(s). <br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--><o:p></o:p></span></div>
<h2>
<span lang="DE" style="font-size: 10.0pt; mso-bidi-font-size: 12.0pt;">The Steps<br />
<!--[endif]--></span><span lang="DE" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt;"><o:p></o:p></span></h2>
<div class="MsoNormal">
<span lang="DE">The following steps allow implementing
JavaScipt stored procedure running in
Oracle database; these steps represent an enhancement from the ones presented
at JavaOne and OOW 2014 -- which consisted in reading the JavaScript from the file system; such approach required granting extra privileges to the
database schema for reading from RDBMS file system something not recommended
from security perspective. Here is a safer approach:<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--></span></div>
<div class="OBodyText" style="margin-left: .25in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">1.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Nashorn
is part of Java 8 but early editions can be built for Java 7; the embedded
JavaVM in Oracle database 12c supports Java 6 (the default) or Java 7. For this
proof of concept, install Oracle database 12c with Java SE 7 <a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn13" name="_ftnref13" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[13]</span></span><!--[endif]--></span></a><o:p></o:p></span></div>
<div class="OBodyText" style="margin-left: .25in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">2.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Build
a standard Nashorn.jar<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn14" name="_ftnref14" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[14]</span></span><!--[endif]--></span></a>;
(ii) modify the Shell code to interpret the given script name as an OJVM
resource; this consists mainly in invoking </span><span style="font-family: "lucida console"; font-size: 9.5pt;">getResourceAsStream()</span><span style="font-family: "times new roman" , "serif"; font-size: 9.0pt;">
</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">on
the current thread's context class loader ; (iii) rebuild Nashorn.jar with the
modified Shell <o:p></o:p></span></div>
<div class="OBodyText" style="margin-left: .25in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "lucida console"; mso-bidi-font-family: "Lucida Console"; mso-bidi-font-size: 8.5pt; mso-fareast-font-family: "Lucida Console";">3.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Load the modified
Nashorn jar into an Oracle database shema e.g., HR <br />
</span><span style="font-family: "lucida console"; font-size: 8.0pt;"> </span><span style="font-family: "lucida console"; font-size: 9.0pt;">loadjava -v -r -u
hr/<password> nashorn.jar</password></span><span style="font-family: "lucida console"; mso-bidi-font-size: 8.5pt;"><o:p></o:p></span></div>
<div class="OBodyText" style="margin-left: .25in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">4.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Create
a new </span><span style="font-family: "lucida console"; font-size: 10.0pt;">dbms_javascript</span><span style="font-family: "times new roman" , "serif"; font-size: 10.0pt;"> </span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">package for invoking Nashorn’s Shell
with a script name as parameter</span><br />
<span style="color: #0070c0; font-family: "lucida console";">create or replace
package dbms_javascript as<br />
procedure run(script varchar2);<br />
end;<br />
/<br />
create or replace package body dbms_javascript as<br />
procedure run(script varchar2) as<br />
language java name
'com.oracle.nashorn.tools.Shell.main(java.lang.String[])';<br />
end;<br />
/</span><span style="color: #0070c0; font-family: "lucida console"; font-size: 9.0pt;">
<br />
</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Then
call </span><span style="font-family: "lucida console"; font-size: 9.5pt;">dbms_javascript,run(‘myscript.js’)</span><span style="font-family: "times new roman" , "serif"; font-size: 10.0pt;">
</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">from
SQL which will invoke Nashorn Shell to
execute the previously loaded </span><span style="font-family: "lucida console"; font-size: 10.0pt;">myscript.js</span><span style="font-family: "times new roman" , "serif"; font-size: 10.0pt;">
</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">.<o:p></o:p></span></div>
<div class="OBodyText" style="margin-left: .25in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="color: #0070c0; font-family: "lucida console"; mso-bidi-font-family: "Lucida Console"; mso-bidi-font-size: 8.5pt; mso-fareast-font-family: "Lucida Console";">5.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Create a custom
role, we will name it NASHORN, as follows, connected as </span><span style="font-family: "lucida console"; font-size: 10.0pt;">SYSTEM</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"> <br />
</span><span style="color: #0070c0; font-family: "lucida console"; mso-bidi-font-size: 8.5pt;">SQL> create role nashorn;<br />
SQL> call dbms_java.grant_permission('NASHORN',
'SYS:java.lang.RuntimePermission', 'createClassLoader', '' );<br />
SQL> call dbms_java.grant_permission('NASHORN',
'SYS:java.lang.RuntimePermission', 'getClassLoader', '' );<br />
SQL> call dbms_java.grant_permission('NASHORN', 'SYS:java.util.logging.LoggingPermission',
'control', '' );</span><span style="color: #0070c0; font-family: "lucida console"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 8.5pt;"><o:p></o:p></span></div>
<div class="OBodyText" style="margin-left: .25in;">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Best practice: insert those statements
in a </span><span style="font-family: "lucida console"; font-size: 9.5pt;">nash-role.sql</span><span style="font-family: "times new roman" , "serif"; font-size: 10.0pt;">
</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">file
and run the script as </span><span style="font-family: "lucida console"; font-size: 10.0pt;">SYSTEM</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="OBodyText" style="margin-left: .25in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">6.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Grant
the </span><span style="font-family: "lucida console"; font-size: 9.5pt;">NASHORN</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"> role created above to the </span><span style="font-family: "lucida console"; font-size: 10.0pt;">HR</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"> schema as
follows (connected as </span><span style="font-family: "lucida console"; font-size: 10.0pt;">SYSTEM</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">):<br />
<br />
</span><span style="font-family: "lucida console"; font-size: 9.5pt;">SQL> grant NASHORN to HR;<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--></span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"><o:p></o:p></span></div>
<div class="OBodyText" style="margin-left: .25in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">7.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Insert
the following JavaScript code in a file e.g., </span><span style="font-family: "lucida console"; font-size: 10.0pt;">database.js
</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">stored on your client machine’s (i.e., a machine
from which you will invoke loadjava as explained in the next step).<br />
This script illustrates using JavaScript and Java as it </span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">uses the server-side
JDBC driver to execute a </span><span style="font-family: "lucida console"; font-size: 9.5pt;">PreparedStatement</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"> to retrieve the
first and last names from the </span><span style="font-family: "lucida console"; font-size: 9.5pt;">EMPLOYEES</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"> table.<o:p></o:p></span><br />
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"><br /></span></div>
<div class="OBodyText" style="margin-left: .25in;">
<span style="color: #0070c0; font-family: "lucida console"; font-size: 9.0pt;">var Driver =
Packages.oracle.jdbc.OracleDriver;<br />
var oracleDriver = new Driver();<br />
var url = "jdbc:default:connection:"; // server-side JDBC driver<br />
var query ="SELECT first_name, last_name from employees";<br />
// Establish a JDBC connection<br />
var connection = oracleDriver.defaultConnection();<br />
// Prepare statement<br />
var preparedStatement = connection.prepareStatement(query);<br />
// execute Query<br />
var resultSet = preparedStatement.executeQuery();<br />
// display results<br />
while(resultSet.next()) {<br />
print(resultSet.getString(1) +
"== " + resultSet.getString(2) + " " );<br />
}<br />
// cleanup<br />
resultSet.close();<br />
preparedStatement.close();<br />
connection.close();</span><span style="color: #0070c0; font-family: "times new roman" , "serif"; font-size: 11.0pt;"><br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--></span><span style="color: #0070c0; font-family: "lucida console"; font-size: 9.0pt;"><o:p></o:p></span></div>
<div class="OBodyText" style="margin-left: .25in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">8.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">Load
</span><span style="font-family: "lucida console"; font-size: 9.5pt;">database.js</span><span style="font-family: "times new roman" , "serif"; font-size: 10.0pt;"> </span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">in the database as a Java
resource (not a vanilla class)<br />
</span><span style="font-family: "lucida console"; font-size: 9.5pt;">loadjava –v –r –u hr/<password> database.js</password></span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"><o:p></o:p></span><br />
<span style="font-family: "lucida console"; font-size: 9.5pt;"><password><br /></password></span></div>
<div class="OBodyText" style="margin-left: .25in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">9.<span style="font-family: "times new roman"; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">To
run the loaded script<o:p></o:p></span><br />
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"><br /></span></div>
<div class="OBodyText" style="margin-left: .25in;">
<span style="color: #0070c0; font-family: "lucida console"; font-size: 9.0pt;">sqlplus hr/<password><br />
SQL>set serveroutput on<br />
SQL>call dbms_java.set_output(80000)<br />
SQL>call dbms_javascript.run(‘database.js’);<o:p></o:p></password></span></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;"><br /></span>
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">The
Nashorn Shell reads ‘</span><span style="font-family: "lucida console"; font-size: 10.0pt;">database.js</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">’ script stored
as Java Resource from internal table; the JavaScript in its turn invokes JDBC to
execute a </span><span style="font-family: "lucida console"; font-size: 10.0pt;">PreparedStatement
</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">and
the result set is displayed on the console. The message “<i>ORA=29515: exit called from Java code with status 0</i>” is due to the
invocation of </span><span style="font-family: "lucida console"; font-size: 9.0pt;">java.lang.Runtime.exitInternal</span><span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">; and status 0
means normal exit (i.e., no error). The fix is to remove that call from
Nashorn.</span><span style="font-family: "times new roman" , serif; font-size: 11pt;"> </span></div>
<h1>
<span lang="DE"><span style="font-size: large;">Node.js on the JVM</span></span></h1>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">As
discussed earlier, Node.js is becoming the man-in-the-middle between Web
applications front ends and back-end legacy components and since companies have
invested a lot in Java, it is highly desirable to co-locate Node.js and Java components
on the same JVM for better integration thereby eliminating the communication
overhead. There are several projects re-implementing Node.js APIs on the JVM
including: Avatar.js, Nodyn, and Trireme. This paper will only discuss Oracle’s
Avatar.js.<o:p></o:p></span></div>
<h1>
<span lang="DE" style="font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Project Avatar.js</span><span class="MsoFootnoteReference"><span lang="DE" style="font-size: 11.0pt;"><a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn15" name="_ftnref15" title=""><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><b><span lang="DE" style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">[15]</span></b></span></a></span></span></h1>
<div class="MsoNormal">
<span lang="DE" style="font-size: 11.0pt;">The goal of project Avatar.js
is to furnish “<i>Node.js on the JVM</i>”;
in other words, an implementation of Node.js APIs, which runs on top of Nashorn
and enables the co-location of Node.js programs and Java components. It has
been outsourced by Oracle under GPL license<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn16" name="_ftnref16" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span lang="DE" style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">[16]</span></span><!--[endif]--></span></a>.
Many Node frameworks and/or applications have been certified to run unchanged
or slightly patched, on Avatar.js. <o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="DE" style="font-size: 11.0pt;"><br /></span></div>
<div class="MsoNormal">
<span lang="DE" style="font-size: 11.0pt;">There are binary
distributions for Oracle Enterprise Linux, Windows and MacOS (64-bits). These builds
can be downloaded from <a href="https://maven.java.net/index.html#welcome">https://maven.java.net/index.html#welcome</a>.
</span><span lang="DE" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt;">Search
for </span><span lang="DE" style="font-family: "lucida console"; font-size: 10.0pt;">avatar-js.jar </span><span lang="DE" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt;">and platform specific </span><span lang="DE" style="font-family: "lucida console"; font-size: 10.0pt;">libavatar-js</span><span lang="DE" style="font-size: 10.0pt; mso-bidi-font-size: 12.0pt;"> </span><span lang="DE" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt;">libraries (</span><span lang="DE" style="font-family: "lucida console"; font-size: 10.0pt;">.dll,
.so, dylib</span><span lang="DE" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt;">).
Get the latest and rename the jar and the specific native libary accordingly. For
example: on Linux, rename the libary to </span><span lang="DE" style="font-family: "lucida console"; font-size: 10.0pt;">avatar-js.so</span><span lang="DE" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt;">; on Windows, rename
the dll to </span><span lang="DE" style="font-family: "lucida console"; font-size: 10.0pt;">avatar-js.dll</span><span lang="DE" style="font-size: 10.0pt; mso-bidi-font-size: 12.0pt;"> </span><span lang="DE" style="font-size: 11.0pt; mso-bidi-font-size: 12.0pt;">and add its location to your
PATH (or use </span><span lang="DE" style="font-family: "lucida console"; font-size: 10.0pt;">-Djava.library.path=<path dll="" to="">).<o:p></o:p></path></span></div>
<div class="MsoNormal">
<br /></div>
<div class="OBodyText">
<span style="font-family: "times new roman" , "serif"; font-size: 11.0pt;">RDBMSes
in general and Oracle database in particular remain the most popular
persistence engines and there are RDBMS specific Node drivers<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftn17" name="_ftnref17" title=""><span class="MsoFootnoteReference"><span class="MsoFootnoteReference"><span style="color: black; font-size: 11pt; letter-spacing: -0.05pt;">[17]</span></span><!--[endif]--></span></a>
as well as ORMs frameworks. However, as we will demonstrate in the following
section, with Avatar.js, we can simply reuse existing Java APIs including JDBC
and UCP for database access.</span></div>
<br />
<h1>
<span lang="DE"><span style="font-size: large;">Node Programming with Oracle
Database using Avatar.js, JDBC and UCP</span></span><span style="font-size: 11pt;"> </span></h1>
<div class="MsoNormal">
<span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">The goal of this proof of concept is to
illustrate the co-location of a Node.js application, the Avatar.js library, the
Oracle JDBC driver and the Oracle Universal Connection Pool (UCP) on the same
Java 8 VM.<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">The sample application consists in a Node.js
application which performs the following actions: <o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">(i) Request a JDBC-Thin connection from the
Java pool (UCP)<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">(ii)Create a PreparedStatement object for “</span><span lang="EN-GB" style="font-family: "lucida console"; font-size: 9.0pt;">SELECT FIRST_NAME, LAST_NAME
FROM EMPLOYEES</span><span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">”<br />
(iii)Execute the statement and return the ResultSet in a callback<br />
(iv)Retrieve the rows and display in browser on port 4000<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">(v) Perform all steps above in a non-blocking
fashion – this is Node.js’s <i>raison d’être</i>.
The demo also uses </span><span lang="EN-GB" style="font-family: "lucida console"; font-size: 10.0pt;">Apache ab</span><span lang="EN-GB" style="font-size: 10.0pt; mso-ansi-language: EN-GB; mso-bidi-font-size: 11.0pt; mso-bidi-font-weight: bold;"> </span><span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">load generator to simulate concurrent users running the same application
in the same/single JVM instance.</span><span style="font-size: 11pt;">For the Node application to scale in the absence of
asynchronous JDBC APIs, we need to turn synchronous calls into non-blocking
ones and retrieve the result set via callback.</span></div>
<h1>
<span lang="EN-GB" style="font-size: 10.0pt; mso-ansi-language: EN-GB;">Turning
Synchronous JDBC Calls into Non-Blocking Calls</span></h1>
<div class="MsoNormal">
<span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-size: 12.0pt;">We will use the following wrapper functions to
turn any JDBC call into a non-blocking call i.e., put the JDBC call into a
thread pool and free up the Node event loop thread.<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;">var makeExecutecallback =
function(userCallback) {<br />
return function(name, args){<br />
...<br />
userCallback(undefined, args[1]);<br />
}<br />
}<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;"> function submit(task, callback, msg) {<br />
var handle = evtloop.acquire();<br />
try { var ret = task();<br />
evtloop.post(new
EventType(msg, callback, null, ret)); {catch{}<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;"> evtloop.submit(r);<br />
}<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-size: 12.0pt;">Let’s apply these wrapper functions to
executeQuery JDBC call, to illustrate the concept</span><span lang="EN-GB"><o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;">exports.connect =
function(userCallback) {..} // JDBC and UCP settings<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;">Statement.prototype.executeQuery
= function(query, userCallback) { <br />
</span><span style="color: #0070c0; font-size: 10.0pt;"> </span><span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;"> var statement =
this._statement; <br />
</span><span style="color: #0070c0; font-size: 10.0pt;"> </span><span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;"> var task = function() { <br />
</span><span style="color: #0070c0; font-size: 10.0pt;"> </span><span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;"> return
statement.executeQuery(query); <br />
</span><span style="color: #0070c0; font-size: 10.0pt;"> </span><span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;"> } </span><span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 9.0pt;"><br />
</span><span style="color: #0070c0; font-size: 10.0pt;"> </span><span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;"> submit(task,
makeExecutecallback(userCallback), "jdbc.executeQuery"); <br />
} <o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-size: 20.0pt; mso-fareast-language: EN-US; mso-font-kerning: 12.0pt;">Similarly the same
technique will be applied to other JDBC statement APIs.<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida console"; font-size: 10.0pt;">Connection.prototype.getConnection
= function() {…}<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida console"; font-size: 10.0pt;">Connection.prototype.createStatement
= function() {..}<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida console"; font-size: 10.0pt;">Connection.prototype.prepareCall
= function(storedprocedure) {..}<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida console"; font-size: 10.0pt;">Statement.prototype.executeUpdate
= function(query, userCallback) {..}</span></div>
<h1>
<span lang="EN-GB" style="font-size: 10.0pt; mso-ansi-language: EN-GB;">Returning
Query ResultSet through a Callback</span></h1>
<div class="MsoNormal">
<span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">The application code fragment hereafter shows
how: for every HTTP request: (i) a connection is requested, (ii) the
PreparedStatement is executed, and (iii) the result set printed on port 4000.<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida console"; font-size: 10.0pt;"> ...<o:p></o:p></span></div>
<div align="left" class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;">
<span style="color: #0070c0; font-family: "lucida console"; font-size: 10.0pt;"> var ConnProvider =
require('./connprovider').ConnProvider;<br />
var connProvider = new ConnProvider(function(err, connection){.. });<br />
<br />
var server = http.createServer(function(request, response) { <br />
connProvider.getConn(function(name,data){..}); <br />
connProvider.prepStat(function(resultset) {<br />
while (resultset.next())
{<br />
response.write(resultset.getString(1) + " --" +
resultset.getString(2));<br />
response.write('<br />');<br />
}<br />
response.write('</span></div>
');<br />
<span style="color: #0070c0; font-family: "lucida sans unicode" , "sans-serif"; font-size: 10.0pt;"> response.end(); <br />
}<br />
server.listen(4000, '127.0.0.1');</span><br />
<div class="MsoNormal">
<span lang="EN-GB">Using Apache
AB, we were able to scale to hundreds of simultaneous invocations of the Node application.
Each instance grabs a Java connection from The Universal Connection Pool (UCP),
executes the SQL statements through JDBC then return the result set via a Callbak
on port 4000.</span></div>
<h1>
<span lang="EN-GB"><span style="font-size: large;">Conclusions</span></span></h1>
<div class="MsoNormal">
<a href="https://www.blogger.com/null" name="OLE_LINK6"></a><a href="https://www.blogger.com/null" name="OLE_LINK5"><span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">Through this paper, i
discussed the rise of JavaScript for server-side programming and how Java is
supporting such evolution; then – something we set out to demonstrate –
furnished step by step details for implementing and running JavaScript stored
procedures in Oracle database 12c using Nashorn as well as running Node.js
applications using Avata.js, Oracle JDBC, UCP against Oracle database 12c.<o:p></o:p></span></a></div>
<div class="MsoNormal">
<span lang="EN-GB" style="font-size: 11.0pt; mso-ansi-language: EN-GB; mso-bidi-font-weight: bold;">As server-side JavaScript (typified by Node.js)
gains in popularity it’ll have to integrate with existing components </span><span style="font-size: 14.6666669845581px;">(COBOL is still alive!!)</span><span style="font-size: 11pt;">. Developers, architects will have to look into co-locating JavaScript with Java, across middle and database tiers.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<br />
<div>
<!--[if !supportFootnotes]--><br clear="all" />
<hr align="left" size="1" width="33%" />
<!--[endif]-->
<br />
<div id="ftn1">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref1" name="_ftn1" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[1]</span></span><!--[endif]--></span></a> <span class="OFootnoteChar"><span lang="DE" style="font-size: 7.0pt; mso-bidi-font-size: 12.0pt;">http://redmonk.com/sogrady/2015/01/14/language-rankings-1-15/<o:p></o:p></span></span></div>
</div>
<div id="ftn2">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref2" name="_ftn2" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[2]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">I’ll discuss the rationale
for running programming languages in the database, later in this paper. </span></div>
</div>
<div id="ftn3">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref3" name="_ftn3" title=""><span class="MsoFootnoteReference"><span style="font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 9.0pt;">[3]</span></span><!--[endif]--></span></span></a><span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;"> Request for </span><span class="OFootnoteChar"><span lang="DE" style="font-size: 7.0pt; mso-bidi-font-size: 12.0pt;">I/O and resource intensive components run in separate process then
invoke a Callback in the main/single Node
thread, when done. </span></span><span style="font-size: 5.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></div>
</div>
<div id="ftn4">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref4" name="_ftn4" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[4]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">http://callbackhell.com/</span></div>
</div>
<div id="ftn5">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref5" name="_ftn5" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[5]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 11.0pt;">Search the web for “<i>Node.js frameworks</i>”</span><span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></div>
</div>
<div id="ftn6">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref6" name="_ftn6" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[6]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino</span></div>
</div>
<div id="ftn7">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref7" name="_ftn7" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[7]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">Performance being one of the
most important</span><span style="font-size: 4.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">aspect </span></div>
</div>
<div id="ftn8">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref8" name="_ftn8" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[8]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">http://www.amazon.com/exec/obidos/ASIN/1555583296</span></div>
</div>
<div id="ftn9">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref9" name="_ftn9" title=""><span class="MsoFootnoteReference"><span style="font-size: 7.0pt;"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 7.0pt;">[9]</span></span><!--[endif]--></span></span></a><span style="font-size: 7.0pt;"> </span><span class="OFootnoteChar"><span lang="DE" style="font-size: 7.0pt;">Rule of thumb: when processing more than ~20-25% of target
data, do it in-place, where data resides (i.e., function shipping).<o:p></o:p></span></span></div>
</div>
<div id="ftn10">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref10" name="_ftn10" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[10]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">In-database Container for
Hadoop is not available, as of this writing.<o:p></o:p></span></div>
</div>
<div id="ftn11">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref11" name="_ftn11" title=""><span class="MsoFootnoteReference"><span style="font-size: 7.0pt;"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 7.0pt;">[11]</span></span><!--[endif]--></span></span></a><span style="font-size: 7.0pt;"> Other than database’s specific procedural language, e.g.,
Oracle’s PL/SQL <o:p></o:p></span></div>
</div>
<div id="ftn12">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref12" name="_ftn12" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[12]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">I discuss this in chapter 2
of my book; see also Oracle database docs.</span></div>
</div>
<div id="ftn13">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref13" name="_ftn13" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[13]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt;">See Multiple JDK Support in http://docs.oracle.com/database/121/JJDEV/E50793-03.pdf<o:p></o:p></span></div>
</div>
<div id="ftn14">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref14" name="_ftn14" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[14]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">Oracle does not furnish a
public download of Nashorn.jar for Java 7; search “<i>Nashorn.jar for Java 7</i>”.<o:p></o:p></span></div>
</div>
<div id="ftn15">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref15" name="_ftn15" title=""><span class="MsoFootnoteReference"><span style="font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 9.0pt;">[15]</span></span><!--[endif]--></span></span></a><span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;"> https://avatar-js.java.net/</span></div>
</div>
<div id="ftn16">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref16" name="_ftn16" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[16]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">https://avatar-js.java.net/license.html</span></div>
</div>
<div id="ftn17">
<div class="MsoFootnoteText">
<a href="file:///C:/My_Data_C/PM/Database/12Planning/JavaScript_Node.doc#_ftnref17" name="_ftn17" title=""><span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference"><span style="color: black; font-family: "arial" , "sans-serif"; font-size: 10.0pt;">[17]</span></span><!--[endif]--></span></a> <span style="font-size: 7.0pt; mso-bidi-font-size: 10.0pt;">The upcoming Oracle Node.js
driver was presented at OOW 2014. </span></div>
</div>
</div>
</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com180tag:blogger.com,1999:blog-25155671.post-75442477520198617772014-11-18T02:31:00.000-08:002014-11-18T02:31:04.380-08:00My DOAG session re:Server-side JavaScript<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://twitter.com/i/redirect?url=https%3A%2F%2Ftwitter.com%2Fsearch%3Fq%3D%2523DOAG%26cn%3DcmV0d2VldA%253D%253D&t=1&cn=cmV0d2VldA%3D%3D&sig=06b29fde00554ab848308c6a6ffe15092778ccf9&iid=c2cf88a3170943cb84a2ae0f177f9461&uid=14618824&nid=6+277" style="background-color: white; border: none; color: #0084b4; direction: ltr; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px; text-decoration: none;" target="_blank">#DOAG</a><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px;"> Wed 19/11 17:00 </span><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px;">rm HongKong Server-side </span><a href="https://twitter.com/i/redirect?url=https%3A%2F%2Ftwitter.com%2Fsearch%3Fq%3D%2523JavaScript%26cn%3DcmV0d2VldA%253D%253D&t=1&cn=cmV0d2VldA%3D%3D&sig=85b6e722a77833f534a3308a7f3ddf68f507b2b2&iid=c2cf88a3170943cb84a2ae0f177f9461&uid=14618824&nid=6+277" style="background-color: white; border: none; color: #0084b4; direction: ltr; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px; text-decoration: none;" target="_blank">#JavaScript</a><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px;"> (</span><a href="https://twitter.com/i/redirect?url=https%3A%2F%2Ftwitter.com%2Fsearch%3Fq%3D%2523NodeJS%26cn%3DcmV0d2VldA%253D%253D&t=1&cn=cmV0d2VldA%3D%3D&sig=04e42483ebefd4f6ae11b10099cbb5ad8dd0f641&iid=c2cf88a3170943cb84a2ae0f177f9461&uid=14618824&nid=6+277" style="background-color: white; border: none; color: #0084b4; direction: ltr; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px; text-decoration: none;" target="_blank">#NodeJS</a><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px;">) progrm</span><a href="https://twitter.com/i/redirect?url=https%3A%2F%2Ftwitter.com%2Fsearch%3Fq%3D%2523OracleDB%26cn%3DcmV0d2VldA%253D%253D&t=1&cn=cmV0d2VldA%3D%3D&sig=90aea33e8f0fd88cabcdf2ea23de5ce7b0aad8e1&iid=c2cf88a3170943cb84a2ae0f177f9461&uid=14618824&nid=6+277" style="background-color: white; border: none; color: #0084b4; direction: ltr; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px; text-decoration: none;" target="_blank">#OracleDB</a><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px;"> using </span><a href="https://twitter.com/i/redirect?url=https%3A%2F%2Ftwitter.com%2Fsearch%3Fq%3D%2523nashorn%26cn%3DcmV0d2VldA%253D%253D&t=1&cn=cmV0d2VldA%3D%3D&sig=ceb10ae31a7bfc99eba6cd5614b583f4d646d22e&iid=c2cf88a3170943cb84a2ae0f177f9461&uid=14618824&nid=6+277" style="background-color: white; border: none; color: #0084b4; direction: ltr; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px; text-decoration: none;" target="_blank">#nashorn</a><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px;"> & Avatar.js --</span><a href="https://twitter.com/i/redirect?url=https%3A%2F%2Ftwitter.com%2Fsearch%3Fq%3D%2523db12c%26cn%3DcmV0d2VldA%253D%253D&t=1&cn=cmV0d2VldA%3D%3D&sig=4879b9ac701d75aa86000c61bbd8553795b62a5e&iid=c2cf88a3170943cb84a2ae0f177f9461&uid=14618824&nid=6+277" style="background-color: white; border: none; color: #0084b4; direction: ltr; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px; text-decoration: none;" target="_blank">#db12c</a><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px;"> </span><a href="https://twitter.com/i/redirect?url=https%3A%2F%2Ftwitter.com%2FOracleDBDev%3Fcn%3DcmV0d2VldA%253D%253D%26refsrc%3Demail&t=1&cn=cmV0d2VldA%3D%3D&sig=b7ca048bb0ed48536760a41186b7d7060301afb1&iid=c2cf88a3170943cb84a2ae0f177f9461&uid=14618824&nid=6+279" style="background-color: white; border: none; color: #0084b4; direction: ltr; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px; text-decoration: none;" target="_blank">@OracleDBDev</a><span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px;"> </span><a href="https://twitter.com/i/redirect?url=https%3A%2F%2Ftwitter.com%2Fsearch%3Fq%3D%2523java%26cn%3DcmV0d2VldA%253D%253D&t=1&cn=cmV0d2VldA%3D%3D&sig=ffcf77803402f67d0391686f05d43fb40f18fd75&iid=c2cf88a3170943cb84a2ae0f177f9461&uid=14618824&nid=6+277" style="background-color: white; border: none; color: #0084b4; direction: ltr; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 22px; line-height: 26px; text-decoration: none;" target="_blank">#java</a><br />
<br />
Will post shortly ablog re: JavaScript Stored Procedures. </div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com17tag:blogger.com,1999:blog-25155671.post-90532424438774370852014-08-19T11:13:00.003-07:002014-08-19T11:13:41.010-07:00ApacheTomcat: How to sustain planned/unplanned Oracle database downtime & Runtime Load Balancing w UCP<div dir="ltr" style="text-align: left;" trbidi="on">
<span class="commentary" id="control_gen_31" style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">See our brand new white paper <complete id="goog_661579142">@ </complete> </span><span style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px;"></span><span style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px;"></span><a data-li-track-url="https://www.linkedin.com/nhome/nus-redirect?url=http%3A%2F%2Fbit%2Ely%2F1ApSIqr&urlhash=tQtC&pos=3%3A1&trkToken=action%3Dcommentary-share-link%26pageKey%3Duscp-home-myupdates%26contextId%3D%2BBNKubvlixOQ4kVeGysAAA%3D%3D%26isFolloweeOfPoster%3Dfalse%26aggregationType%3Dnone%26actorType%3Dlinkedin%3Amember%26feedPosition%3D3%26verbType%3Dlinkedin%3Ashare%26isDigested%3Dfalse%26rowPosition%3D1%26objectType%3Dlinkedin%3Aarticle%26moduleKey%3Dhp_feed%26activityId%3Dactivity%3A5906941617671000064%26actorId%3Dmember%3A523320%26isPublic%3Dtrue%26model%3Dnus%3Ahomepage_federator_relevance_093_control%26objectId%3Darticle%3A-1%26distanceFromViewer%3D0%26isSponsored%3Dfalse&tev=0" href="https://www.linkedin.com/redirect?url=http%3A%2F%2Fbit%2Ely%2F1ApSIqr&urlhash=tQtC&_t=commentary-share-link&trk=commentary-share-link" style="background-color: white; border: 0px; color: #0077b5; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">http://bit.ly/1ApSIqr</a><span class="commentary" id="control_gen_32" style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span></div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com3tag:blogger.com,1999:blog-25155671.post-16033109775751557392014-06-21T21:56:00.000-07:002014-06-21T21:56:08.479-07:00Preview [video]: Apps HA Solutions for Planned & Unplanned DB Downtime w UCP <div dir="ltr" style="text-align: left;" trbidi="on">
http://bit.ly/V0Dycf </div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com0tag:blogger.com,1999:blog-25155671.post-16150764515561150382014-06-18T19:45:00.002-07:002014-06-18T19:45:20.756-07:00My sessions at JavaOne and OOW 2014<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif;"><b>My sessions at JavaOne 2014 San Francisco</b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b><br /></b></span>
<span class="abbreviation" style="background-color: whitesmoke; color: #333399; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px;"><a class="openInPopup" href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=1815" style="background-color: whitesmoke; color: #333399; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px;">CON1815</a> - </span><a class="openInPopup" href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=1815" style="background-color: whitesmoke; color: #333399; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px;"><span class="title" style="background-color: whitesmoke; color: #333399; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px;">JavaScript Across Tiers with Nashorn and Avatar.js</span><span style="background-color: whitesmoke; color: #333399; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px;"><span style="background-color: whitesmoke; list-style: none;"> </span></span></a><br />
<br />
<a href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=1826"><span class="abbreviation" style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><span style="background-color: whitesmoke; list-style-image: initial; list-style-position: initial;">BOF1826</span> - </span><span class="title" style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">MapReduce over an RDBMS: JDBC Storage Handler or In-Database Container for Hadoop?</span><span style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><span style="background-color: whitesmoke; list-style: none;"> </span></span></a><br />
<br />
<a href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=1851"><span class="abbreviation" style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><span style="background-color: whitesmoke; list-style-image: initial; list-style-position: initial;">CON1851</span> - </span><span class="title" style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Java Applications: At-Most-Once COMMIT Protocol and Capture/Replay Database Calls</span></a><span style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><span style="background-color: whitesmoke; list-style: none;"><a class="openInPopup" href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=1851"> </a></span></span><br />
<span style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><br /></span>
<b><span style="font-family: Arial, Helvetica, sans-serif;">Other JavaOne sessions from my teams</span></b><br />
<b><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></b>
<span class="abbreviation" style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px;"><a class="openInPopup" href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=2152" style="color: #1f4f82; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">CON2152</a> - </span><a class="openInPopup" href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=2152" style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><span class="title" style="list-style: none; margin: 0px; padding: 0px;">DistributableStream: A Java 8 Stream Computational Model for Big Data Processing</span><span style="color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px;"><span style="list-style: none;"> </span></span></a><br />
<br />
<b><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></b>
<b><span style="font-family: Arial, Helvetica, sans-serif;">My sessions at Oracle OpenWorld 2014</span></b><br />
<br />
<div style="text-align: left;">
<a href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=8300"><span class="abbreviation" style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><span style="background-color: whitesmoke; list-style-image: initial; list-style-position: initial;">CON8300</span> - </span><span class="title" style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Analyze Oracle Database Data from Hadoop Compute Engines (HiveQL, Spark, Impala, and others)</span><span style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><span style="background-color: whitesmoke; list-style: none;"> </span></span></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<a href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=7757"><span class="abbreviation" style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><span style="background-color: whitesmoke; list-style-image: initial; list-style-position: initial;">CON7757</span> - </span><span class="title" style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;">Design Applications for Planned and Unplanned Database Downtime</span><span style="background-color: whitesmoke; color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px; text-decoration: none;"><span style="background-color: whitesmoke; list-style: none;"> </span></span></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<a href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=8373"><span class="abbreviation" style="color: #1f4f82; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px;"><span style="list-style-image: initial; list-style-position: initial;">CON8373</span> - </span><span style="color: #1f4f82; font-family: Arial, Verdana, sans-serif;"><span style="background-color: whitesmoke; list-style: none;">In-Database MapReduce: Near Real-Time Analytics with Hadoop and SQL</span></span></a></div>
<div style="text-align: left;">
<span style="color: #1f4f82; font-family: Arial, Verdana, sans-serif;"><span style="background-color: whitesmoke; list-style: none;"><br /></span></span></div>
<div style="text-align: left;">
<a href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=7787"><span class="abbreviation" style="background-color: whitesmoke; color: #333399; font-family: Arial, Verdana, sans-serif; list-style: none; margin: 0px; padding: 0px;"><span style="background-color: whitesmoke; list-style-image: initial; list-style-position: initial;">CON7787</span> - </span><span style="color: #333399; font-family: Arial, Verdana, sans-serif;"><span style="background-color: whitesmoke; list-style: none;">JavaScript and Node.js Apps with Oracle Database 12c, Using Nashorn, Avatar.js, and JDBC</span></span></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<b><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></b></div>
<div style="text-align: left;">
<b><span style="font-family: Arial, Helvetica, sans-serif;">Other OOW sessions from my teams</span></b></div>
<h1 style="background-color: white; color: #666666; font-family: Arial, Verdana, sans-serif; font-weight: normal; line-height: 1em; list-style: none; margin: 0px 0px 0.4em; padding: 0px;">
<span style="font-size: small;"><a href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=7785&tclass=popup">CON7785 - </a></span><span style="line-height: 1em;"><a href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=7785&tclass=popup"><span style="font-size: small;">Performance/Scalability with JDBC, Oracle Universal Connection Pool, and Oracle Database 12c</span></a></span><span style="line-height: 1em;"><span style="font-size: small;"> </span></span></h1>
</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com1tag:blogger.com,1999:blog-25155671.post-66848134282612003352014-02-27T04:15:00.000-08:002014-02-27T04:15:00.785-08:00Run Scala directly in Oracle database<div dir="ltr" style="text-align: left;" trbidi="on">
<span class="commentary" id="control_gen_37" style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">A nice proof of concept for #Scala, #java, #Oracle, and #db12c, afficionados </span><span style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px;"></span><span style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px;"></span><a data-li-track-url="http://www.linkedin.com/nhome/nus-redirect?url=http%3A%2F%2Fbit%2Ely%2F1o8gejG&urlhash=AOhv&trkToken=action%3Dcommentary-share-link%26pageKey%3Duscp-home-myupdates%26contextId%3D2EvrTtC3VhPQmHUijysAAA%3D%3D%26isSponsored%3Dfalse%26distanceFromViewer%3D0%26aggregationType%3Dnone%26isPublic%3Dtrue%26verbType%3Dlinkedin%3Ashare%26activityId%3Dactivity%3A5844775189816041472%26isDigested%3Dfalse%26isFolloweeOfPoster%3Dfalse%26actorType%3Dlinkedin%3Amember%26feedPosition%3D1%26actorId%3Dmember%3A523320%26objectId%3Darticle%3A7433654154284120337%26rowPosition%3D1%26objectType%3Dlinkedin%3Aarticle&goback=%2Enmp_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1" href="http://www.linkedin.com/redirect?url=http%3A%2F%2Fbit%2Ely%2F1o8gejG&urlhash=AOhv&_t=commentary-share-link&trk=commentary-share-link" style="background-color: white; border: 0px; color: #0077b5; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;" target="_blank">http://bit.ly/1o8gejG</a><br />
<br /></div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com1tag:blogger.com,1999:blog-25155671.post-72231201783835410092014-02-17T09:27:00.001-08:002014-02-17T09:27:47.684-08:00En route for OTN Yathra<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px;">En route for OTN Yathra (</span><a href="http://t.co/E0KUudWOLn" rel="nofollow nofollow" style="background-color: white; color: #3b5998; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px; text-decoration: none;" target="_blank">http://t.co/E0KUudWOLn</a><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px;">) first stop Mumbai customers visits </span><a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/java" style="background-color: white; color: #3b5998; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px; text-decoration: none;">#java</a><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px;"> </span><a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/db12c" style="background-color: white; color: #3b5998; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px; text-decoration: none;">#db12c</a><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px;"> </span><a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/mapreduce" style="background-color: white; color: #3b5998; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px; text-decoration: none;">#mapreduce</a><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px;"> </span><a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/hadoop" style="background-color: white; color: #3b5998; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px; text-decoration: none;">#hadoop</a><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px;"> </span><a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/oracletechnet" style="background-color: white; color: #3b5998; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px; text-decoration: none;">#oracletechnet</a></div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com2tag:blogger.com,1999:blog-25155671.post-6856957351593342072014-02-05T18:17:00.004-08:002014-02-05T18:17:55.475-08:00Rocky Mountain OUG: what's up Feb 6th @ 8:30am in Room 504?<div dir="ltr" style="text-align: left;" trbidi="on">
Why get up early and show up in Room 504? <a data-li-track-url="http://www.linkedin.com/nhome/nus-redirect?url=http%3A%2F%2Fbit%2Ely%2F1cgzgy1&urlhash=DHvr&trkToken=action%3Dcommentary-share-link%26pageKey%3Duscp-home-myupdates%26contextId%3DOD8%2BzRIlUBPQvN8%2B7ioAAA%3D%3D%26isSponsored%3Dfalse%26distanceFromViewer%3D0%26aggregationType%3Dnone%26isPublic%3Dtrue%26verbType%3Dlinkedin%3Ashare%26activityId%3Dactivity%3A5837015413728219136%26isDigested%3Dfalse%26isFolloweeOfPoster%3Dfalse%26actorType%3Dlinkedin%3Amember%26feedPosition%3D1%26actorId%3Dmember%3A523320%26objectId%3Darticle%3A7443545981629193300%26rowPosition%3D1%26objectType%3Dlinkedin%3Aarticle&goback=%2Enmp_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1" href="http://www.linkedin.com/redirect?url=http%3A%2F%2Fbit%2Ely%2F1cgzgy1&urlhash=DHvr&_t=commentary-share-link&trk=commentary-share-link" style="background-color: white; border: 0px; color: #0077b5; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px; margin: 0px; outline: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">http://bit.ly/1cgzgy1</a><span style="background-color: white; color: #333333; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px;"> </span><span class="commentary" id="control_gen_49" style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 17px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">#Java #db12c #OracleRac</span></div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com1tag:blogger.com,1999:blog-25155671.post-18518996136121950302014-01-29T10:01:00.001-08:002014-01-29T10:01:17.371-08:00Speaking at OTN Yathra (India)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px;">Speaking @ </span><a href="http://www.facebook.com/l.php?u=http%3A%2F%2Ft.co%2FE0KUudWOLn&h=4AQF64DyNAQFCwe20I57ia0_Zi3VVJ-cdgA_8oJUEqgBrzg&s=1" rel="nofollow nofollow" style="background-color: white; color: #3b5998; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px; text-decoration: none;" target="_blank">http://t.co/E0KUudWOLn</a><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px;"> Mumbai/Pune/Chennai In-Database</span><a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/mapreduce" style="background-color: white; color: #3b5998; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px; text-decoration: none;">#MapReduce</a><span style="background-color: white; color: #333333; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px;"> for DBAs and Database Developers using SQL or </span><a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/hadoop" style="background-color: white; color: #3b5998; cursor: pointer; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 17.940000534057617px; text-decoration: none;">#Hadoop</a></div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com1tag:blogger.com,1999:blog-25155671.post-34066006544174662432014-01-24T15:16:00.003-08:002014-01-24T15:16:36.985-08:00Rocky Mountain Oracle Users group event<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="tG QF" style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px; position: absolute; width: 0px;">
</div>
<div class="Ct" style="background-color: white; color: #404040; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18.200000762939453px;">
Join me at <a class="ot-hashtag aaTEdf" href="https://plus.google.com/s/%23RMOUG" rel="nofollow" style="-webkit-transition: color 0.218s; color: #427fed; cursor: pointer; font-weight: bold; text-decoration: none; transition: color 0.218s;">#RMOUG</a> Feb 6th 8:30 Rm 504:; i'll be presenting <a class="ot-hashtag aaTEdf" href="https://plus.google.com/s/%23Java" rel="nofollow" style="-webkit-transition: color 0.218s; color: #427fed; cursor: pointer; font-weight: bold; text-decoration: none; transition: color 0.218s;">#Java</a>Perf., Scalability, Availability & Security w Oracle <a class="ot-hashtag aaTEdf" href="https://plus.google.com/s/%23db12c" rel="nofollow" style="-webkit-transition: color 0.218s; color: #427fed; cursor: pointer; font-weight: bold; text-decoration: none; transition: color 0.218s;">#db12c</a> --<a class="ot-hashtag aaTEdf" href="https://plus.google.com/s/%23OracleRac" rel="nofollow" style="-webkit-transition: color 0.218s; color: #427fed; cursor: pointer; font-weight: bold; text-decoration: none; transition: color 0.218s;">#OracleRac</a> -- <a class="ot-anchor aaTEdf" href="http://bit.ly/1cgzgy1" rel="nofollow" style="-webkit-transition: color 0.218s; color: #427fed; cursor: pointer; text-decoration: none; transition: color 0.218s;" target="_blank">http://bit.ly/1cgzgy1</a></div>
</div>
Kuassi Mensahhttp://www.blogger.com/profile/17181349306854451284noreply@blogger.com3