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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:59:55+00:00 2026-05-23T05:59:55+00:00

I just downloaded the microsoft jdbc mssql driver to try connect my test app…

  • 0

I just downloaded the microsoft jdbc mssql driver to try connect my test app… The lib contains so many methods so I have confused … There is a BLOB and InputStream can be used but I am not sure which one I need to insert FileInputStream for example? I couldn’t find any tutorial showing that, moreover, I want to insert image with t-sql procedure…
So my question is…
How to insert FileInputStream to MS SQL Server 2005 table with Java client app as…

A) With no procedure
B) With t-sql procedure

Any useful tutorial will be much appreciated

  • 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-23T05:59:56+00:00Added an answer on May 23, 2026 at 5:59 am

    There’s an example in the MSDN documentation for the JDBC driver, and a similar example here (found by Googling for “mssql jdbc insert image”). Both of these examples seem to rely on using setBinaryStream() on a PreparedStatement to pass a FileInputStream into a BLOB-type field field.

    Third example below for reference:

    PreparedStatement pstmt = con.prepareStatement("INSERT INTO BigTable (Col1) VALUES(?)");
    FileInputStream inStream = new FileInputStream(new File("myImg.gif"));
    pstmt.setBinaryStream(1, inStream);
    pstmt.executeUpdate();
    inStream.close();
    

    In response to question B, I assume that it’s possible to create a stored procedure with a BLOB parameter and then pass in an input stream using CallableStatement#setBinaryStream very similar to the above, e.g.,

    CallableStatement cstmt = con.prepareCall("{AddImage(?)}");
    FileInputStream inStream = new FileInputStream(new File("myImg.gif"));
    cstmt.setBinaryStream(1, inStream);
    cstmt.executeQuery();
    inStream.close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just downloaded and installed Microsoft Enterprise Library 5.0 . I fired up VS
I just downloaded one sample from this link :- http://msdn.microsoft.com/en-us/library/ff431744%28v=VS.92%29.aspx But when i try
Just downloaded the new Kinect SDK Beta from Microsoft and am really excited to
I have just downloaded and installed the VC++ 2010 Express tool from Microsoft. I
I recently just downloaded Microsoft Enterprise Library 4.1 – October 2008 and in the
I just downloaded the VHD for windows xp: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11575 But when I start the
I just downloaded the Webmatrix 2 Prerelease Beta- http://www.microsoft.com/web/gallery/install.aspx?appid=webmatrix&prerelease=true I played around and made
I just downloaded the Microsoft.Web.Helpers package from nupack and added linkshare to my site
I just downloaded the latest release of the source code to the Microsoft Enterprise
Just downloaded the Visual Studio 2010 Premium and realized that can't compile the project,

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.