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

The Archive Base Latest Questions

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

I have a Java application that uses an Apache Derby database with the embedded

  • 0

I have a Java application that uses an Apache Derby database with the embedded driver. Right now, in the installation, I run the SQL create scripts out of process.

So when the application starts up, the tables are already existing. Recently I’ve started to think it would be better to have my SQL script in the classpath or something, load it, and execute all the statements so that the tables are created upon startup. The database itself can be autocreated if missing, so this seems like it might be a less error-prone way to bootstrap the tables.

My question is: Am I likely to run into any issues with detecting existence/creating tables in process on application startup vs. expecting them to be set up properly by my install?

  • 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-16T17:07:41+00:00Added an answer on May 16, 2026 at 5:07 pm

    I think your first step should be to build them during the install and fail gracefully at runtime. Then flesh out the fail gracefully part to be self-repairing.

    Detecting and handling error conditions in process is, IMO, always better than assuming (expecting) and crashing.

    I would advocate not “expecting” tables to be set up properly by the install. I’m not saying you shouldn’t set the database up during the install. What I’m advocating for is code that verifies database integrity. If you have code that verifies the existence and design of your schema and can repair/rebuild, then you don’t need to worry about whether the install set everything up properly. This doesn’t mean you shouldn’t do that creation during the install, especially if it’s slow.

    I know that a lot of the apps I develop these days have built in migrations based on app version. Basically, when the app starts up it goes through a DB validation/verification cycle, determines the state of the database, and performs associated migrations based on database version and code version.

    This requires you to be diligent with up and down migrations (or just up, if you never need to rev back) but I’ve found it to be a very slick and useful solution. Of course, you need it to be robust against multiple startups, user configuration differences, and be able to handle error situations gracefully, but that’s par for the course, in my opinion.

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

Sidebar

Ask A Question

Stats

  • Questions 535k
  • Answers 535k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer it looks like very broad question. There are many scalability… May 17, 2026 at 1:06 am
  • Editorial Team
    Editorial Team added an answer Create the dialog as a WPF UserControl Library. Add it… May 17, 2026 at 1:06 am
  • Editorial Team
    Editorial Team added an answer Checkout statCVS. Here is a brief set of feature list… May 17, 2026 at 1:06 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a Java application (generic) that uses a database via hibernate. I ship
I have a Java web application that currently uses Log4J for logging. I'd like
We have a Spring application that uses Apache DBCP for connection pooling. Our app
I have a Java application, built with eclipse, that uses QTJambi. Running the application
I have a C++ application and a Java application that need to log messages
I am working on a Java/Struts application that uses Tomcat 6.0.10. It's a typical
I run iPlanet's Java application server, something in it is loading commons-logging-1.0.4.jar . That's
I have a Java console application that is launched from a batch script in
I have an application that uses an external jar. I used eclipse and it
We have a Java product that uses a lot of FOSS/COTS software. A number

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.