First, this is my first time with Apache Derby. I am using netbeans, willing to use embedded apache derby, downloaded derby seperatly (it is also in glassfish, but I reset it to my downloaded one)and I followed the following tutorial for configuring and installing the database. Then, I attached the derby.jar file to my project, using project properties.
But, when I am trying to insert data into the database, it is giving me the following error
Why is this? Please help!
Apart from that first main question, I would like to ask another 2 questions.
2. I have to give the explicit location of the database as the connection here. But, when I give this to a client, how can I do that?
3. I have to start the database connection manually using netbeans. Is there anyway to start the database connection automatically? Using code?
I have posted this in another place too, but still no good. Please help me. Thanks
Are you better than me? Then please show me my mistakes..
Rob Spoor wrote:The exception looks clear enough to me:
Yohan Weerasinghe wrote:
You are running another program that uses the same database, or have incorrectly closed such a program. The database is marked as "in use".
The NullPointerExceptions after that are caused by this error; your Connection object remains null but you still try to use it.
Thanks for the reply Rob, I really appreciate it. But, the case is, there is no such a connection open. I have tried this using all the connection closing techniques I know, including restarting and shutting down the computer.Still, I get the same. Is this is happening because I replaced the derby given by glassfish with the one I downloaded? I don't think anyway. Please help.
Can you also tell us which other place that is, with a direct link to the thread in question?
sure..But, seems like I have followed the way of "Network Derby". I am looking for embedded one, which can be moved from machine to machine, along with the program (yes, new DB will get created in every machine, it is OK ). Not something like MS SQL Server which you need to connect all the computers into another machine which has the DB. Will post the complete answer when it is figured out, or, start a new question here if I failed