Solved

Failed to start database error

Posted on 2012-03-23
6
571 Views
Last Modified: 2016-11-23
when i wrote code to create my second table in derby i got the following error-
java.sql.SQLException: Failed to start database 'C:/Users/Dell/Documents/NetBeansProjects/RCSSystem/newdemo'
attaching the whole error ....
please help..
run.txt
0
Comment
Question by:daydreamer6565
  • 4
6 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 37760099
That is probably because you use "create=true" in the connection string -
you should not use it if you already created database
Table should be created with SQL command like
stmt.executeUpdate("create table....")
and you should not have create=true in connection string if you alreday have file "newdemo" with the database
0
 

Author Comment

by:daydreamer6565
ID: 37760114
I removed "create=true" from my connection code...but still the error is coming..
attaching the modified connection code... Pls help..
connection-code.txt
0
 
LVL 47

Expert Comment

by:for_yan
ID: 37760123
so error did not change at all?

Do you have newdemo folder in
C:\Users\Dell\Documents\NetBeansProjects\RCSSystem\  ?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 47

Expert Comment

by:for_yan
ID: 37760125
check if you ahve file db.lck inside newdemo folder

http://db.apache.org/derby/docs/dev/devguide/cdevdvlp20458.html


Derby prevents two instances of itself from booting the same database by using a file called db.lck inside the database directory.

If a second instance of Derby attempts to boot an already running database, the following error messages appear:

ERROR XJ040: Failed to start database 'firstdb', see the next exception
for details.
ERROR XSDB6: Another instance of Derby may have already booted the
database /home/myself/DERBYTUTOR/firstdb.

In addition, a stack trace appears in the derby.log file. For help diagnosing a double boot problem, use the derby.stream.error.logBootTrace property to obtain information about both successful and unsuccessful boot attempts. The property is described in the Derby Reference Manual.
0
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 37760127
Are you sure you are not riunning simpulateneosly two instances of your application ?
Derby deos not allow two instances to opne db in one folder
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 37760403
Make sure you completely stop your application while you're working on it - iow don't have another instance running in another thread
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now