Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Failed to start database error

Posted on 2012-03-23
6
Medium Priority
?
600 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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 1500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

926 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