Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8464699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:49:55+00:00 2026-06-10T14:49:55+00:00

I’m currently working with Java Stored Procedures in Oracle and am seeing some strange

  • 0

I’m currently working with Java Stored Procedures in Oracle and am seeing some strange behaviour when attempting to get a connection within my Java code.

My Java is packaged up into a jar file and then deployed into Oracle using the loadjava command line utility. A package is then created in the database which maps each method in a designated Java class to a PL/SQL function via call specifications.

Some of the columns which I’m working with are CLOBs. In the Java I attempt to extract the value of this CLOB (mapped in call specification as oracle.sql.CLOB) into a String:

private static String getStringFromCLOB(CLOB clob) throws SQLException {
    long length = clob.length();
    return clob.getSubString(1, (int) length);
}

When I run this code I get the following stack trace showing up in SQL*Plus:

java.lang.ArithmeticException: / by zero
    at oracle.jdbc.driver.T2SConnection.<init>(T2SConnection.java:107)
    at oracle.jdbc.driver.T2SDriverExtension.getConnection(T2SDriverExtension.java:31)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:481)
    at oracle.jdbc.driver.OracleDriver.defaultConnection(OracleDriver.java:505)
    at oracle.sql.DatumWithConnection.getPhysicalConnection(DatumWithConnection.java:53)
    at oracle.sql.DatumWithConnection.getInternalConnection(DatumWithConnection.java:177)
    at oracle.sql.CLOB.getDBAccess(CLOB.java:1383)
    at oracle.sql.CLOB.length(CLOB.java:197)

Before I was just seeing the message of the Exception so I wrapped the offending method’s contents with a try / catch so I could dump the full stack trace to the System.out.

It is worth noting that I have had this working on Oracle 11.2.0.1.0 (32bit) but it is not working on Oracle 11.2.0.2.0 (64bit).

I have also had other Java-backed PL/SQL functions working without a problem. It is only the ones that attempt to make a connection that fail.

I have had a look in <ORACLE_HOME>\jdbc\lib and the jars, although named the same, seem to be different in these two distributions. The jars in the directory are (11.2.0.1.0 size and 11.2.0.2.0 size shown):

  • ojdbc5.jar (1,950KB | 1,983KB)
  • ojdbc5_g.jar (3,010KB | 3,271KB)
  • ojdbc5dms.jar (2,374KB | 2,489KB)
  • ojdbc5dms_g.jar (3,030KB | 3,291KB)
  • ojdbc6.jar (2,062KB | 2,102KB)
  • ojdbc6_g.jar (3,323KB | 3,782KB)
  • ojdbc6dms.jar (2,594KB | 2,698KB)
  • ojdbc6dms_g.jar (3,344KB | 3,805KB)
  • simplefan.jar (20KB | 20KB) <– probably the same

The manifest files of these jars confirm they are built for the specific version, i.e. 11.2.0.1.0 or 11.2.0.2.0. Is it possible a bug has been introduced in 11.2.0.2.0? Or is it more likely to be user, i.e. my, error 🙂

Also, where does the oracle.jdbc.driver.T2SConnection class live?

Any help / guidance very much appreciated. Please let me know if you need more information.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:49:57+00:00Added an answer on June 10, 2026 at 2:49 pm

    To those that might come across this issue we discovered that it was caused by a corruption of the JVM install within Oracle. This probably occurred due to a bad installation.

    Reinstalling the JVM aspect of Oracle allowed oracle.jdbc.driver.OracleConnection.defaultConnection() to run without any issues whether explicitly called or called as part of the stack of another call, e.g. oracle.sql.CLOB.length().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I have thousands of HTML files to process using Groovy/Java and I need to
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a bunch of posts stored in text files formatted in yaml/textile (from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.