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

  • Home
  • SEARCH
  • 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 193865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:32:47+00:00 2026-05-11T16:32:47+00:00

I am work on a project in oracle 9i. I was having a problem

  • 0

I am work on a project in oracle 9i. I was having a problem with toplink 10.1.3 loading a particular row in a table. It turns out the jdbc driver that toplink is relying on is acting very funny. Perhaps someone here can help…

I have a table named: crazytable. It has a column: “ver_num number(19) not null default 0”. This column was added to the table as part of the original insert some years ago. When I select any record (see below for jdbc connection code) from crazytable and attempt to do an rs.getLong(colIndex), everything works fine. However, if I do a rs.getObject(colIndex), I get a stacktrace:

java.lang.ArrayIndexOutOfBoundsException: 1
    at oracle.sql.NUMBER.toBigDecimal(NUMBER.java:651)
    at oracle.jdbc.dbaccess.DBConversion.NumberBytesToBigDecimal(DBConversion.java:2805)
    at oracle.jdbc.driver.OracleStatement.getBigDecimalValue(OracleStatement.java:4539)
    at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:5666)
    at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:5622)
    at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java:739)
    at oracle.jdbc.driver.OracleResultSet.getObject(OracleResultSet.java:1470)
    stacktrace truncated to protect my poor code...

I can take another table, lets call it: sanetable, and run this same query against a column with the same name and type “ver_num number(19) not null default 0”. And rs.getLong(colIndex) and rs.getObject(colIndex) work just fine.

Neither column is involved in a constraint, or index. I have tried oracle driver 9.2.0.8, 9.2.0.5, 9.2.0.1, even 10.* (which won’t work).

Does anyone know anything about what I can do here?

This is my basic connection code. The only difference between the successful calls is the particular table in question:

            Class.forName(oracle.jdbc.OracleDriver.class.getName());
    String url = "jdbc:oracle:thin:@IPADDRESS:PORT:INSTANCE";
        Connection conn = null;
        ResultSet rs = null;
        try {
            conn = DriverManager.getConnection(url, "user","pass");
            PreparedStatement prepareStatement = conn.prepareStatement(
                    "select distinct ver_num " +

                    "FROM [crazytable|sanetable] " 
                    );
            rs = prepareStatement.executeQuery();
            assertNotNull(rs);
            while (rs.next()) {
                ResultSetMetaData md = rs.getMetaData();
                for (int i = 1; i <= md.getColumnCount(); i++) {
                    String key = md.getColumnLabel(i);
                    Object value = rs.getLong(key);
                    System.out.println(key+" : "+value 
                            +" was null: "+rs.wasNull()
                            +" type: "+ rs.getType()
                            +" class: "+ md.getColumnClassName(i));
                }
            }
        } finally {
            if (rs != null) {
                rs.close();
            }
            if (conn != null) {
                conn.close();
            }
        }

edit: The driver can be found on this page: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html

  • 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-05-11T16:32:48+00:00Added an answer on May 11, 2026 at 4:32 pm

    Okay I think I figured this out. I was looking through some other questions and noticed there are other oracle type 4 drivers. One of which is DataDirect (http://datadirect.com). I used a trial version of their driver and it was able to return the rs.getObject(intIndex).

    The value was: -1.6777120E-27.

    So rs.getLong() was rounding down to zero, but the BigDecimal was seeing a decimal part and throwing an exception.

    Perhaps this is due to oracle’s driver being compiled with jdbc1.4 vs, something newer for datadirect.

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

Sidebar

Ask A Question

Stats

  • Questions 112k
  • Answers 112k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Ternary operator does not appear to be appropriate in your… May 11, 2026 at 9:56 pm
  • Editorial Team
    Editorial Team added an answer Yes? Honestly, what are you asking for? Why don't you… May 11, 2026 at 9:56 pm
  • Editorial Team
    Editorial Team added an answer I've been bitten by it once, reading a dictionary file… May 11, 2026 at 9:56 pm

Related Questions

I have an Oracle project that would be a good fit for using GUIDs
I am wondering what are the heuristics when creating releases of libraries to be
I am working on a legacy project in VC++/Win32/MFC . Recently it became a
I am starting to work on a hobby project with a Python codebase and
I am working on a project that requires the manipulation of enormous matrices, specifically

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.