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 8353277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:12:30+00:00 2026-06-09T09:12:30+00:00

Just whacking together an export from an old DB that contains binary data, I

  • 0

Just whacking together an export from an old DB that contains binary data, I stumbled over an exception in one of our utility methods:

java.lang.AbstractMethodError: net.sourceforge.jtds.jdbc.BlobImpl.free()

After checking our codebase, I found that utility method was never used until now, bascially it looks like this:

public BinaryHolder getBinary(final int columnIndex) throws SQLException {
    Blob blob = null;
    try {
        blob = resultSet.getBlob(columnIndex);
        final BinaryHolder binary = BinaryHolderUtil.create(blob);
        return binary;
    } finally {
        if (blob != null)
            blob.free();
    }
}

BinaryHolder is just a wrapper that holdes the binary data (and before you ask, the code executes fine until it reaches the finally clause – BinaryHolderUtil.create(blob) does not attempt to free the blob).

Investigating further I found that everywhere else we access Blob’s, the blob is just obtained using getBlob() and not free’d at all (The Javadoc says it will be automatically disposed of when the result set is closed).

Question now: Should the blob be free()’d manually (after all the ResultSet may be held for more than just accessing the blob), and if yes how can it be free()’d in a way that works even with a driver that does not implement it?

(We are using SQL-Server with JTDS1.25, if that wasn’t already obvious from the exception)

  • 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-09T09:12:32+00:00Added an answer on June 9, 2026 at 9:12 am

    The Blob.free() was introduced in JDBC 4.0 / Java 6. So you are most likely using a JDBC 3.0 or earlier JDBC driver.

    As with most (JDBC) resources, closing them as soon as possible has its advantages (eg GC can collect it earlier, database resources are freed etc). That is also why you can close a ResultSet even though it is closed when you close the statement (or execute the statement again), just like you can close a Statement even though it is closed when the Connection is closed.

    So a Blob does not need to be freed, but it is – in general – a good idea to free it when you are done with it.

    BTW: JTDS is only JDBC 3.0, you would be better off using the Microsoft SQL Server JDBC driver of Microsoft itself.

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

Sidebar

Related Questions

I just spent a whole week tracking down and whacking memory leaks over the
Just wondering will it be possible to passing a value from one page (window
just wanted to ask where I define initial class properties? From other languages I
Just see this: SELECT clientid,clientname,startdate,enddate,age FROM clients WHERE clientid IN (1,2,3,4,5) AND CASE WHEN
Just had a question regarding the UILabel class. I know that the UITextField control
Just working on getting more fluent in Visual Basic over the summer so I'm
Just a quick check really. I have an XML file that I will be
Just a quick question. I have an NSArray that is generated in my applicationDidFinishLaunching
Just wondering what it is that I am doing wrong here?? It's very simple
just like the query below : select sum(T.a), sum(T.b) from Table T group by

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.