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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:46:10+00:00 2026-05-23T06:46:10+00:00

I’m trying to insert a file in a blob field in a Firebird database

  • 0

I’m trying to insert a file in a blob field in a Firebird database using lib jaybird 2.1.6.

First, I create a record in my database, then, with the id of record, I try to insert my file in a blob (subtype 0) field.

Here is my code:

public static boolean insertBlob(File p_file, String p_maxId) {
    String requette = 
        "UPDATE MAIL_RECU a SET a.CONTENU=? where a.ID_MESSAGE_RECU="+ p_maxId;

    PreparedStatement ps = null;
    FileInputStream input = null;
    try {
        ps = laConnexion.prepareStatement(requette);
        input = new FileInputStream(p_file);

        int paramIdx = 1;
        ps.setBinaryStream(paramIdx++, input, p_file.length());
        ps.executeUpdate();
    } catch (SQLException e) {
        System.out.println("cause: " + e.getCause());
        System.out.println("stacktrace: " + e.getStackTrace());
        System.out.println(e);
        messageUtilisateur.affMessageException(e,
                "Erreur à l'insertion d'un blob");
    } catch (FileNotFoundException e) {
        messageUtilisateur.affMessageException(e,
                "impossible de trouver le fichier");
    } finally {
        try {
            ps.close();
            input.close();

        } catch (SQLException e) {
            messageUtilisateur.affMessageException(e,
                    "Erreur à l'insertion d'un blob");
        } catch (IOException e) {
            messageUtilisateur.affMessageException(e, "fichier non trouvé");

        }
    }

    return true;
}

The problem is I have an exception when

ps.setBinaryStream(paramIdx++, input, p_file.length());

is executed.

I have a message “java.sql.SQLException: not yet implemented”. My question is, is anyone have already have this problem? If yes, how did he (or she) fix it? Is there another way to store file in blob with jaybird?

  • 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-23T06:46:11+00:00Added an answer on May 23, 2026 at 6:46 am

    setBinaryStream(int, InputStream, long) is a JDBC4 (Java 6) method.

    As far as I know Jaybird is still JDBC3, so you need to use PreparedStatement.setBinaryStream(int, InputStream, int) instead:

    ps.setBinaryStream(paramIdx++, input, (int)p_file.length());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to render a haml file in a javascript response like so:
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to create an if statement in PHP that prevents a single post
I have a reasonable size flat file database of text documents mostly saved in
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.