Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Failed to start database error

Posted on 2012-03-23
6
Medium Priority
?
594 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
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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.
Suggested Courses

722 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