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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:17:00+00:00 2026-05-31T10:17:00+00:00

I have a Java application that parses files and stores the data I need

  • 0

I have a Java application that parses files and stores the data I need in a SQLite database.

I’m trying to have it store the data in a remote MySQL database that is on my hosts’ server instead.

I rewrote the queries that had a different syntax, but I still have a problem: it’s going way slower than when I do it locally using a SQLite database. Is it something I have to live with since one is local while the other is a remote connection, or is there something I should know before continuing?

As an example, parsing 636 files and storing all the data I need (some of the data is useless, I have to sort some of it, etc.) takes 2.5 minutes when I use the SQLite database. That’s about 4.24 files per second. On average, it takes about 15 seconds per file when I’m using the MySQL database, so it would take about 63 times longer using the MySQL database.

What I think the main problem might be, but I don’t know how to solve it: each file has, on average, 190 inserts. Since the files are statistics sheets for a bowling center and each game is a row (60 players per league times 3 games), plus some checks to see if the league exists in the leagues table, schedule, etc., I can’t really just make less inserts since all the information is important.

I think it would help a lot if I could group all the inserts for the games part in one big insert, but I have no idea if that’s possible / how it’s possible / if it’s even worth it or if the problem is elsewhere.

I’d like to know if I’m at least on the right track or if I should get used to my application taking that much time to store the data since it is remotely connected.

  • 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-31T10:17:01+00:00Added an answer on May 31, 2026 at 10:17 am

    Since no one replied with an answer and that I found something I could do to improve performance, I’m going to post it here so people can use this in the future if, like me, they didn’t know about batches.

    I was using PreparedStatements (but regular statements would have worked the same), and instead of doing the usual ps.executeUpdate(); to execute my queries, I used ps.addBatch(); between different queries and then ps.executeBatch(); when I was done building the queries and wanted to make one big INSERT with everything in the batch.

    Note that when doing this, if your connection is named conn, you should do conn.setAutoCommit(false); before starting the batch and conn.commit(); after ps.executeBatch();. You can then set autoCommit back to true after this if you’d like.

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

Sidebar

Related Questions

I have a Java application that parses pdf files in a directory and its
I have a Java application that monitors a folder for incoming XML files. When
I have a java application that is connected to a view on a remote
We have a Java application that stores RSA public keys and allows a user
For my work I have to develop a small Java application that parses very
I have an application that passes in java.util.Date. I want to check whether this
I have a Java application that launches another java application. The launcher has a
I have a Java application that's very String-heavy - it takes a feed of
I have a java application that has Web Services published using Axis. With the
We have a Java application that needs to be brought to the foreground when

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.