Solved

Failed to start database error

Posted on 2012-03-23
6
582 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

624 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