Solved

Failed to start database error

Posted on 2012-03-23
6
573 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AD FSMO Issues 14 93
javap bin 2 28
Performance Issue Dell / HP Vmware SAP 18 64
use lov values 2 33
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
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.

920 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

14 Experts available now in Live!

Get 1:1 Help Now