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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:07:16+00:00 2026-05-31T19:07:16+00:00

I am generating a byte array of size about 250MB. This is then being

  • 0

I am generating a byte array of size about 250MB. This is then being inserted into a table in a remote Microsoft SQL Server using standard JDBC code in a Java application.

My first setup – application running on one Amazon EC2 instance, Microsoft SQL Server running on a separate Amazon EC2 instance. In this case the INSERT statement works – pass.

My second setup – application running locally on my laptop, database hosted on the Amazon EC2 instance. Here the connection is made correctly but on the line
pstmt.executeQuery(1, byteArray);
the program keeps running without terminating even after say half an hour – fail.

To check that I am actually able to access and insert data into the remote DB from my local machine, I wrote a trivial application to insert one integer into the table – pass.

I suspect that since I do not have a really fast internet connection, my data upload fails. Is there anyway to speed up the data transfer from JDBC to the remote SQL Server database.

I have thought about increasing the packet size on the SQL Server – but I am not sure if this is the right way, since it works when using another Amazon EC2 instance to run the same application – only not when running from local instance of the application. Running Amazon EC2 instances for every developer on the team is an expensive proposition.

  • 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-31T19:07:17+00:00Added an answer on May 31, 2026 at 7:07 pm

    Your problem is network latency and not the database itself.

    Think about how can you optimize transfer of the file to the EC2 instance. Sending a 250mb file in a sync manner is never a good way. This will always cause problems. Uploading the file and inserting it in the database are two different things. Do not mix them,

    Thing you should do:

    1. compress the file as much as you can and then send it. AND
    2. Use ftp or http (same performance though) and upload the file to the server. Then do what ever you want to with that file on the server. (like inserting it to the database)

    OR

    1. The other super-awesome way of transmitting large file over the network is: split the file in chunks (after compressing it), send them asynchronously (eg: twister in python or nio in java) and finally merge all the files on the server side (use checksum to validate the integrity of the file).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to understanding this code, which is about generating a Huffman tree .
if I'm generating images using servlets/actions something like this: byte[] imageBytes = getImageAsBytes(); response.setContentType(image/jpeg);
I have the displeasure of generating table creation scripts for Microsoft Access. I have
I'm looking at the possibility of generating Java byte code at run time (hopefully
I am generating a GUID using the following statement in my code byte[ ]
I'm procedurally generating 128-byte blocks with some set n-byte header reserved for machine-language functions
this is somewhat a newbie question probably. I'm generating keypairs with Java: KeyPairGenerator keyGen
I'm generating HTML from a database and then sending it to PrinceXML for conversion
I have a UDA in SQL 2005 that keeps generating the below error. I'm
Generating normal columnar data in excel file is quite easy but does any one

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.